#include "gstopenh264elements.h"
#include "gstopenh264enc.h"
+#include <gst/pbutils/pbutils.h>
#include <gst/gst.h>
#include <gst/base/base.h>
#include <gst/video/video.h>
return TRUE;
}
+static guint8
+gst_openh264enc_get_level_from_caps (GstCaps *outcaps, GstCaps *allowed_caps)
+{
+ GstStructure *s = gst_caps_get_structure (outcaps, 0);
+ const gchar * level = gst_structure_get_string (gst_caps_get_structure (allowed_caps, 0), "level");
+
+ if (!level)
+ return LEVEL_UNKNOWN;
+
+ gst_structure_set (s, "level", G_TYPE_STRING, level, NULL);
+ return gst_codec_utils_h264_get_level_idc (level);
+}
+
static EProfileIdc
gst_openh264enc_get_profile_from_caps (GstCaps *outcaps, GstCaps *allowed_caps)
{
enc_params.fMaxFrameRate = fps_n * 1.0 / fps_d;
enc_params.iLoopFilterDisableIdc = openh264enc->deblocking_mode;
enc_params.sSpatialLayers[0].uiProfileIdc = gst_openh264enc_get_profile_from_caps (outcaps, allowed_caps);
+ enc_params.sSpatialLayers[0].uiLevelIdc = (ELevelIdc) gst_openh264enc_get_level_from_caps (outcaps, allowed_caps);
enc_params.sSpatialLayers[0].iVideoWidth = enc_params.iPicWidth;
enc_params.sSpatialLayers[0].iVideoHeight = enc_params.iPicHeight;
enc_params.sSpatialLayers[0].fFrameRate = fps_n * 1.0 / fps_d;
c_args : gst_plugins_bad_args,
link_args : noseh_link_args,
include_directories : [configinc],
- dependencies : [gstvideo_dep, openh264_dep],
+ dependencies : [gstvideo_dep, openh264_dep, gstpbutils_dep, ],
install : true,
install_dir : plugins_install_dir,
)