summaryrefslogtreecommitdiff
path: root/ext/openh264
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2014-10-03 17:22:23 +0300
committerSebastian Dröge <sebastian@centricular.com>2014-10-03 17:23:36 +0300
commit518d84c14810614904e957b085f34ad5232f7217 (patch)
tree1f2a773af331191efd78487d062040cc5511d64b /ext/openh264
parentbc8e1465dc1029019e378eb901cf562bdf4d2f4e (diff)
downloadgstreamer-plugins-bad-518d84c14810614904e957b085f34ad5232f7217.tar.gz
openh264dec: The codec can only do baseline so simplify the code a bit
and declare this also on the srcpad caps. With baseline profile there are no B-frames or frame reordering.
Diffstat (limited to 'ext/openh264')
-rw-r--r--ext/openh264/gstopenh264dec.cpp33
1 files changed, 4 insertions, 29 deletions
diff --git a/ext/openh264/gstopenh264dec.cpp b/ext/openh264/gstopenh264dec.cpp
index f036fb930..428a884a3 100644
--- a/ext/openh264/gstopenh264dec.cpp
+++ b/ext/openh264/gstopenh264dec.cpp
@@ -86,7 +86,7 @@ GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS
- ("video/x-h264, stream-format=(string)byte-stream, alignment=(string)au"));
+ ("video/x-h264, stream-format=(string)byte-stream, alignment=(string)au,profile=(string){constrained-baseline,baseline}"));
static GstStaticPadTemplate gst_openh264dec_src_template =
GST_STATIC_PAD_TEMPLATE ("src",
@@ -252,32 +252,6 @@ gst_openh264dec_reset (GstVideoDecoder * decoder, gboolean hard)
return TRUE;
}
-static GstVideoCodecFrame *
-get_oldest_pts_frame (GstVideoDecoder * decoder)
-{
- GList *frames, *l;
- GstVideoCodecFrame *oldest = NULL;
-
- frames = gst_video_decoder_get_frames (decoder);
- for (l = frames; l; l = l->next) {
- GstVideoCodecFrame *tmp = (GstVideoCodecFrame *) l->data;
-
- if (tmp->pts != GST_CLOCK_TIME_NONE &&
- (oldest == NULL || oldest->pts > tmp->pts))
- oldest = tmp;
- }
-
- if (oldest)
- gst_video_codec_frame_ref (oldest);
- else
- oldest = gst_video_decoder_get_oldest_frame (decoder);
-
- g_list_foreach (frames, (GFunc) gst_video_codec_frame_unref, NULL);
- g_list_free (frames);
-
- return oldest;
-}
-
static GstFlowReturn
gst_openh264dec_handle_frame (GstVideoDecoder * decoder,
GstVideoCodecFrame * frame)
@@ -338,8 +312,9 @@ gst_openh264dec_handle_frame (GstVideoDecoder * decoder,
/* FIXME: openh264 has no way for us to get a connection
* between the input and output frames, we just have to
- * guess based on the input */
- frame = get_oldest_pts_frame (decoder);
+ * guess based on the input. Fortunately openh264 can
+ * only do baseline profile. */
+ frame = gst_video_decoder_get_oldest_frame (decoder);
if (!frame) {
/* Can only happen in finish() */
return GST_FLOW_EOS;