summaryrefslogtreecommitdiffstats
path: root/common/recipes-multimedia/gstreamer/gstreamer1.0-omx/0009-omxwmvdec-support-VC-1-advanced-profile.patch
blob: 3d31b1c19abde0db96397e078600fdd4da41e02e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
From 5ad42791ad2d93bd694bf5faa466ccaffee7d23b Mon Sep 17 00:00:00 2001
From: Kazunori Kobayashi <kkobayas@igel.co.jp>
Date: Wed, 19 Jun 2013 16:03:02 +0900
Subject: [PATCH 09/14] omxwmvdec: support VC-1 advanced profile

If VC-1 advanced profile stream is demuxed, codec_data has a sequence
header and a entry point header. At the beginning of playback,
this patch pushes a buffer which is the concatenation of sequence header,
entry point header and first frame data to decode the advanced profile
stream.
---
 omx/gstomxwmvdec.c | 28 +++++++++++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)

diff --git a/omx/gstomxwmvdec.c b/omx/gstomxwmvdec.c
index 0f8f2db..a3bd3c5 100644
--- a/omx/gstomxwmvdec.c
+++ b/omx/gstomxwmvdec.c
@@ -107,7 +107,33 @@ static GstFlowReturn
 gst_omx_wmv_dec_prepare_frame (GstOMXVideoDec * self,
     GstVideoCodecFrame * frame)
 {
-  if (self->codec_data) {
+  GstCaps *caps;
+  gboolean is_ap = FALSE;
+  GstStructure *structure;
+  const gchar *fourcc;
+
+  if (self->codec_data == NULL)
+    return GST_FLOW_OK;
+
+  caps = gst_pad_get_current_caps (GST_VIDEO_DECODER_SINK_PAD (self));
+  structure = gst_caps_get_structure (caps, 0);
+  fourcc = gst_structure_get_string (structure, "format");
+  if (fourcc) {
+    if (strncmp (fourcc, "WVC1", strlen ("WVC1")) == 0) {
+      GST_INFO_OBJECT (self, "stream type is Advanced Profile");
+      is_ap = TRUE;
+    } else {
+      GST_INFO_OBJECT (self, "stream type is Simple/Main Profile");
+      is_ap = FALSE;
+    }
+  }
+  gst_caps_unref (caps);
+
+  if (is_ap) {
+    frame->input_buffer =
+        gst_buffer_append (self->codec_data, frame->input_buffer);
+    self->codec_data = NULL;
+  } else {
     OMX_PARAM_PORTDEFINITIONTYPE port_def;
     guint32 *SeqHdrBuf;
     guint8 *u8ptr;
-- 
1.8.1.2