*/
#include "gst/vaapi/sysdeps.h"
-#include <gst/video/videocontext.h>
#include <gst/vaapi/gstvaapidisplay.h>
#include <gst/vaapi/gstvaapiencoder_priv.h>
#include <gst/vaapi/gstvaapiencoder_objects.h>
#include "gstvaapiencode.h"
+#include "gstvaapivideocontext.h"
#include "gstvaapipluginutil.h"
#include "gstvaapivideometa.h"
#include "gstvaapivideomemory.h"
#endif
/* context(display) interface */
+#if GST_CHECK_VERSION(1,1,0)
+static void
+gst_vaapiencode_set_context (GstElement * element, GstContext * context)
+{
+ GstVaapiEncode *const encode = GST_VAAPIENCODE (element);
+ GstVaapiDisplay *display = NULL;
+
+ if (gst_vaapi_video_context_get_display (context, &display)) {
+ GST_INFO_OBJECT (element, "set display %p", display);
+ gst_vaapi_display_replace (&encode->display, display);
+ }
+}
+#else
static void
gst_vaapiencode_set_video_context (GstVideoContext * context,
const gchar * type, const GValue * value)
{
iface->set_context = gst_vaapiencode_set_video_context;
}
+#endif
G_DEFINE_TYPE_WITH_CODE (GstVaapiEncode,
gst_vaapiencode, GST_TYPE_VIDEO_ENCODER,
G_IMPLEMENT_INTERFACE (GST_TYPE_IMPLEMENTS_INTERFACE,
gst_vaapiencode_implements_iface_init);
#endif
+#if !GST_CHECK_VERSION(1,1,0)
G_IMPLEMENT_INTERFACE (GST_TYPE_VIDEO_CONTEXT,
- gst_video_context_interface_init))
+ gst_video_context_interface_init)
+#endif
+ )
static gboolean
gst_vaapiencode_query (GstPad * pad, GstObject * parent,
gst_vaapiencode_class_init (GstVaapiEncodeClass * klass)
{
GObjectClass *const object_class = G_OBJECT_CLASS (klass);
+ GstElementClass *const element_class = GST_ELEMENT_CLASS (klass);
GstVideoEncoderClass *const venc_class = GST_VIDEO_ENCODER_CLASS (klass);
GST_DEBUG_CATEGORY_INIT (gst_vaapiencode_debug,
klass->allocate_buffer = gst_vaapiencode_default_allocate_buffer;
+#if GST_CHECK_VERSION(1,1,0)
+ element_class->set_context = GST_DEBUG_FUNCPTR (gst_vaapiencode_set_context);
+#endif
+
/* Registering debug symbols for function pointers */
GST_DEBUG_REGISTER_FUNCPTR (gst_vaapiencode_get_caps);
GST_DEBUG_REGISTER_FUNCPTR (gst_vaapiencode_query);
#include "gstvaapiencode_h264.h"
#include "gstvaapipluginutil.h"
+#include "gstvaapivideomemory.h"
#include "gst/vaapi/gstvaapiencoder_h264.h"
#include "gst/vaapi/gstvaapiencoder_h264_priv.h"
#include "gst/vaapi/gstvaapidisplay.h"
#define GST_CAPS_CODEC(CODEC) CODEC "; "
static const char gst_vaapiencode_h264_sink_caps_str[] =
+#if GST_CHECK_VERSION(1,1,0)
+ GST_VIDEO_CAPS_MAKE_WITH_FEATURES (GST_CAPS_FEATURE_MEMORY_VAAPI_SURFACE,
+ "{ ENCODED, NV12, I420, YV12 }") ", "
+#else
GST_VIDEO_CAPS_MAKE (GST_VIDEO_FORMATS_ALL) ", "
GST_CAPS_INTERLACED_FALSE "; "
GST_VAAPI_SURFACE_CAPS ", "
+#endif
GST_CAPS_INTERLACED_FALSE;
static const char gst_vaapiencode_h264_src_caps_str[] =
#include "gstvaapiencode_mpeg2.h"
#include "gstvaapipluginutil.h"
+#include "gstvaapivideomemory.h"
#include "gst/vaapi/gstvaapiencoder_mpeg2.h"
#include "gst/vaapi/gstvaapiencoder_mpeg2_priv.h"
#include "gst/vaapi/gstvaapidisplay.h"
#define GST_CAPS_CODEC(CODEC) CODEC "; "
static const char gst_vaapiencode_mpeg2_sink_caps_str[] =
+#if GST_CHECK_VERSION(1,1,0)
+ GST_VIDEO_CAPS_MAKE_WITH_FEATURES(GST_CAPS_FEATURE_MEMORY_VAAPI_SURFACE,
+ "{ ENCODED, NV12, I420, YV12 }") ", "
+ GST_CAPS_INTERLACED_FALSE;
+#else
GST_VIDEO_CAPS_MAKE (GST_VIDEO_FORMATS_ALL) "; "
GST_VAAPI_SURFACE_CAPS;
+#endif
static const char gst_vaapiencode_mpeg2_src_caps_str[] =
GST_CAPS_CODEC ("video/mpeg,"