summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Decina <alessandro.d@gmail.com>2014-11-27 13:33:07 +0100
committerSebastian Dröge <sebastian@centricular.com>2014-12-16 15:08:43 +0100
commit749f39c89f0d341059dec327e5e309154bf9d210 (patch)
tree97be27422b434a302cedd768a79e4d28893a0a10
parent86bdc8ca1aff226b256aab05286129aca50bfcb0 (diff)
downloadgstreamer-plugins-bad-749f39c89f0d341059dec327e5e309154bf9d210.tar.gz
vtenc: set profile and level in caps
-rw-r--r--sys/applemedia/Makefile.am1
-rw-r--r--sys/applemedia/vtenc.c9
2 files changed, 9 insertions, 1 deletions
diff --git a/sys/applemedia/Makefile.am b/sys/applemedia/Makefile.am
index 01c340c6b..e05c092f2 100644
--- a/sys/applemedia/Makefile.am
+++ b/sys/applemedia/Makefile.am
@@ -33,6 +33,7 @@ libgstapplemedia_la_LIBADD = \
$(GST_PLUGINS_BASE_LIBS) \
-lgstvideo-$(GST_API_VERSION) \
-lgstaudio-$(GST_API_VERSION) \
+ -lgstpbutils-$(GST_API_VERSION) \
$(GMODULE_NO_EXPORT_LIBS)
libgstapplemedia_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS) --tag=CC
diff --git a/sys/applemedia/vtenc.c b/sys/applemedia/vtenc.c
index e257d9e36..ccbb34d84 100644
--- a/sys/applemedia/vtenc.c
+++ b/sys/applemedia/vtenc.c
@@ -26,6 +26,7 @@
#include "coremediabuffer.h"
#include "corevideobuffer.h"
#include "vtutil.h"
+#include <gst/pbutils/codec-utils.h>
#define VTENC_DEFAULT_USAGE 6 /* Profile: Baseline Level: 2.1 */
#define VTENC_DEFAULT_BITRATE 0
@@ -445,9 +446,10 @@ gst_vtenc_negotiate_downstream (GstVTEnc * self, CMSampleBufferRef sbuf)
CFDictionaryRef atoms;
CFStringRef avccKey;
CFDataRef avcc;
- gpointer codec_data;
+ guint8 *codec_data;
gsize codec_data_size;
GstBuffer *codec_data_buf;
+ guint8 sps[3];
fmt = CMSampleBufferGetFormatDescription (sbuf);
atoms = CMFormatDescriptionGetExtension (fmt,
@@ -462,6 +464,11 @@ gst_vtenc_negotiate_downstream (GstVTEnc * self, CMSampleBufferRef sbuf)
gst_structure_set (s, "codec_data", GST_TYPE_BUFFER, codec_data_buf, NULL);
+ sps[0] = codec_data[1];
+ sps[1] = codec_data[2];
+ sps[2] = codec_data[3];
+ gst_codec_utils_h264_caps_set_level_and_profile (caps, sps, 3);
+
gst_buffer_unref (codec_data_buf);
}