diff options
author | Edward Hervey <edward@centricular.com> | 2018-03-05 16:44:32 +0100 |
---|---|---|
committer | TOA Developer <justin@boris> | 2018-03-08 15:32:56 +0100 |
commit | 6cc647b5ce11d8b350a1cf494a8c55245f5e6e5e (patch) | |
tree | 3628ed7d88e8d94c80b11e89ba954e6a83ef745f | |
parent | 892ba1d847277a8a4353b78695b66081e2c1337e (diff) |
WIP more decklink work
-rw-r--r-- | sys/decklink/gstdecklink.cpp | 2 | ||||
-rw-r--r-- | sys/decklink/gstdecklinkvideosrc.cpp | 45 |
2 files changed, 27 insertions, 20 deletions
diff --git a/sys/decklink/gstdecklink.cpp b/sys/decklink/gstdecklink.cpp index 18dc03878..7da4a5950 100644 --- a/sys/decklink/gstdecklink.cpp +++ b/sys/decklink/gstdecklink.cpp @@ -471,7 +471,7 @@ gst_decklink_video_format_from_type (BMDPixelFormat pf) if (formats[i].format == pf) return formats[i].vformat; } - g_assert_not_reached (); + GST_WARNING ("Unknown pixel format 0x%x", pf); return GST_VIDEO_FORMAT_UNKNOWN; } diff --git a/sys/decklink/gstdecklinkvideosrc.cpp b/sys/decklink/gstdecklinkvideosrc.cpp index 18291efcf..ed0c47481 100644 --- a/sys/decklink/gstdecklinkvideosrc.cpp +++ b/sys/decklink/gstdecklinkvideosrc.cpp @@ -912,25 +912,32 @@ gst_decklink_video_src_create (GstPushSrc * bsrc, GstBuffer ** buffer) vf = gst_decklink_video_format_from_type (vanc_frame->GetPixelFormat ()); - GST_DEBUG_OBJECT (self, "Have ancillary data ?"); - // FIXME : We are blindly assuming that: - // 1) The first active video line is 22 - // 2) That there is only one field - for (fi = 1; fi < 22; fi++) { - if (vanc_frame->GetBufferForVerticalBlankingLine (fi, - (void **) &vancdata) == S_OK) { - GstVideoAncillary gstanc; - if (parser == NULL) - parser = gst_video_vbi_parser_new (vf, mode->width); - GST_DEBUG_OBJECT (self, "Might have data on line %d", fi); - gst_video_vbi_parser_add_line (parser, vancdata); - while (gst_video_vbi_parser_get_ancillary (parser, &gstanc) == GST_VIDEO_VBI_PARSER_RESULT_OK) { - if (GST_VIDEO_ANCILLARY_DID16 (&gstanc) == GST_VIDEO_ANCILLARY_DID16_S334_EIA_708) { - GST_DEBUG_OBJECT (self, "Adding CEA-708 CDP meta to buffer"); - GST_MEMDUMP_OBJECT (self, "CDP", gstanc.data, gstanc.data_count); - gst_buffer_add_video_caption_meta (*buffer, GST_VIDEO_CAPTION_TYPE_CEA708_CDP, gstanc.data, gstanc.data_count); - } - } + if (vf != GST_VIDEO_FORMAT_UNKNOWN) { + GST_DEBUG_OBJECT (self, "Checking for ancillary data in VBI"); + // FIXME : We are blindly assuming that: + // 1) The first active video line is 22 + // 2) That there is only one field + for (fi = 1; fi < 22; fi++) { + if (vanc_frame->GetBufferForVerticalBlankingLine (fi, + (void **) &vancdata) == S_OK) { + GstVideoAncillary gstanc; + if (parser == NULL) + parser = gst_video_vbi_parser_new (vf, mode->width); + GST_DEBUG_OBJECT (self, "Might have data on line %d", fi); + gst_video_vbi_parser_add_line (parser, vancdata); + while (gst_video_vbi_parser_get_ancillary (parser, + &gstanc) == GST_VIDEO_VBI_PARSER_RESULT_OK) { + if (GST_VIDEO_ANCILLARY_DID16 (&gstanc) == + GST_VIDEO_ANCILLARY_DID16_S334_EIA_708) { + GST_DEBUG_OBJECT (self, "Adding CEA-708 CDP meta to buffer"); + GST_MEMDUMP_OBJECT (self, "CDP", gstanc.data, + gstanc.data_count); + gst_buffer_add_video_caption_meta (*buffer, + GST_VIDEO_CAPTION_TYPE_CEA708_CDP, gstanc.data, + gstanc.data_count); + } + } + } } } vanc_frame->Release (); |