]> git.sesse.net Git - nageru/blobdiff - nageru/decklink_output.cpp
Collapse all the 10-bit flags.
[nageru] / nageru / decklink_output.cpp
index 91fbd4095c23c94532823a4158e223845ae43b5c..4c478fdf8e667353ef5de338a6cbd82a20df878b 100644 (file)
@@ -172,7 +172,7 @@ void DeckLinkOutput::start_output(uint32_t mode, int64_t base_pts, bool is_maste
 
        BMDDisplayModeSupport support;
        IDeckLinkDisplayMode *display_mode;
-       BMDPixelFormat pixel_format = global_flags.ten_bit_output ? bmdFormat10BitYUV : bmdFormat8BitYUV;
+       BMDPixelFormat pixel_format = global_flags.bit_depth > 8 ? bmdFormat10BitYUV : bmdFormat8BitYUV;
        if (output->DoesSupportVideoMode(mode, pixel_format, bmdVideoOutputFlagDefault,
                                         &support, &display_mode) != S_OK) {
                fprintf(stderr, "Couldn't ask for format support\n");
@@ -297,7 +297,7 @@ void DeckLinkOutput::send_frame(GLuint y_tex, GLuint cbcr_tex, YCbCrLumaCoeffici
        }
 
        unique_ptr<Frame> frame = get_frame();
-       if (global_flags.ten_bit_output) {
+       if (global_flags.bit_depth > 8) {
                chroma_subsampler->create_v210(y_tex, cbcr_tex, width, height, frame->uyvy_tex);
        } else {
                chroma_subsampler->create_uyvy(y_tex, cbcr_tex, width, height, frame->uyvy_tex);
@@ -310,7 +310,7 @@ void DeckLinkOutput::send_frame(GLuint y_tex, GLuint cbcr_tex, YCbCrLumaCoeffici
        glBindBuffer(GL_PIXEL_PACK_BUFFER, frame->pbo);
        check_error();
 
-       if (global_flags.ten_bit_output) {
+       if (global_flags.bit_depth > 8) {
                glBindTexture(GL_TEXTURE_2D, frame->uyvy_tex);
                check_error();
                glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV, BUFFER_OFFSET(0));
@@ -540,7 +540,7 @@ unique_ptr<DeckLinkOutput::Frame> DeckLinkOutput::get_frame()
        unique_ptr<Frame> frame(new Frame);
 
        size_t stride;
-       if (global_flags.ten_bit_output) {
+       if (global_flags.bit_depth > 8) {
                stride = v210Converter::get_v210_stride(width);
                GLint v210_width = stride / sizeof(uint32_t);
                frame->uyvy_tex = resource_pool->create_2d_texture(GL_RGB10_A2, v210_width, height);
@@ -598,7 +598,7 @@ void DeckLinkOutput::present_thread_func()
                check_error();
                frame->fence.reset();
 
-               if (global_flags.ten_bit_output) {
+               if (global_flags.bit_depth > 8) {
                        memcpy(frame->uyvy_ptr_local.get(), frame->uyvy_ptr, v210Converter::get_v210_stride(width) * height);
                } else {
                        memcpy(frame->uyvy_ptr_local.get(), frame->uyvy_ptr, width * height * 2);
@@ -692,7 +692,7 @@ long DeckLinkOutput::Frame::GetHeight()
 
 long DeckLinkOutput::Frame::GetRowBytes()
 {
-       if (global_flags.ten_bit_output) {
+       if (global_flags.bit_depth > 8) {
                return v210Converter::get_v210_stride(global_flags.width);
        } else {
                return global_flags.width * 2;
@@ -701,7 +701,7 @@ long DeckLinkOutput::Frame::GetRowBytes()
 
 BMDPixelFormat DeckLinkOutput::Frame::GetPixelFormat()
 {
-       if (global_flags.ten_bit_output) {
+       if (global_flags.bit_depth > 8) {
                return bmdFormat10BitYUV;
        } else {
                return bmdFormat8BitYUV;