mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 02:31:03 +00:00
vtenc: set profile and level in caps
This commit is contained in:
parent
082c12b8e2
commit
6a4270d5cc
2 changed files with 9 additions and 1 deletions
|
@ -33,6 +33,7 @@ libgstapplemedia_la_LIBADD = \
|
||||||
$(GST_PLUGINS_BASE_LIBS) \
|
$(GST_PLUGINS_BASE_LIBS) \
|
||||||
-lgstvideo-$(GST_API_VERSION) \
|
-lgstvideo-$(GST_API_VERSION) \
|
||||||
-lgstaudio-$(GST_API_VERSION) \
|
-lgstaudio-$(GST_API_VERSION) \
|
||||||
|
-lgstpbutils-$(GST_API_VERSION) \
|
||||||
$(GMODULE_NO_EXPORT_LIBS)
|
$(GMODULE_NO_EXPORT_LIBS)
|
||||||
|
|
||||||
libgstapplemedia_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS) --tag=CC
|
libgstapplemedia_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS) --tag=CC
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#include "coremediabuffer.h"
|
#include "coremediabuffer.h"
|
||||||
#include "corevideobuffer.h"
|
#include "corevideobuffer.h"
|
||||||
#include "vtutil.h"
|
#include "vtutil.h"
|
||||||
|
#include <gst/pbutils/codec-utils.h>
|
||||||
|
|
||||||
#define VTENC_DEFAULT_USAGE 6 /* Profile: Baseline Level: 2.1 */
|
#define VTENC_DEFAULT_USAGE 6 /* Profile: Baseline Level: 2.1 */
|
||||||
#define VTENC_DEFAULT_BITRATE 0
|
#define VTENC_DEFAULT_BITRATE 0
|
||||||
|
@ -445,9 +446,10 @@ gst_vtenc_negotiate_downstream (GstVTEnc * self, CMSampleBufferRef sbuf)
|
||||||
CFDictionaryRef atoms;
|
CFDictionaryRef atoms;
|
||||||
CFStringRef avccKey;
|
CFStringRef avccKey;
|
||||||
CFDataRef avcc;
|
CFDataRef avcc;
|
||||||
gpointer codec_data;
|
guint8 *codec_data;
|
||||||
gsize codec_data_size;
|
gsize codec_data_size;
|
||||||
GstBuffer *codec_data_buf;
|
GstBuffer *codec_data_buf;
|
||||||
|
guint8 sps[3];
|
||||||
|
|
||||||
fmt = CMSampleBufferGetFormatDescription (sbuf);
|
fmt = CMSampleBufferGetFormatDescription (sbuf);
|
||||||
atoms = CMFormatDescriptionGetExtension (fmt,
|
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);
|
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);
|
gst_buffer_unref (codec_data_buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue