summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2018-02-21 10:56:47 -0600
committerNicolas Dufresne <nicolas.dufresne@collabora.com>2018-02-27 17:51:02 -0500
commit25c2a0d35396a6b58847a83a8617ef87a3f6a899 (patch)
treec07f36c40fe515dd95e84942e303462eafdbba27
parentba28c6cff2c7e6675d227c2bcbdd8c4a05f9824f (diff)
Revert "vaapiencode: handle custom event GstVaapiEncoderRegionOfInterest"
This reverts commit 8f1b88dac0e64a211325cdcb2cda693b80229bd1. https://bugzilla.gnome.org/show_bug.cgi?id=768248
-rw-r--r--gst/vaapi/gstvaapiencode.c39
-rw-r--r--gst/vaapi/gstvaapiencode_h264.c74
2 files changed, 0 insertions, 113 deletions
diff --git a/gst/vaapi/gstvaapiencode.c b/gst/vaapi/gstvaapiencode.c
index 5bc67c55..159cd859 100644
--- a/gst/vaapi/gstvaapiencode.c
+++ b/gst/vaapi/gstvaapiencode.c
@@ -787,45 +787,6 @@ gst_vaapiencode_sink_event (GstVideoEncoder * venc, GstEvent * event)
GstPad *const srcpad = GST_VAAPI_PLUGIN_BASE_SRC_PAD (encode);
gboolean ret;
- switch (GST_EVENT_TYPE (event)) {
- case GST_EVENT_CUSTOM_DOWNSTREAM:{
- const GstStructure *s = gst_event_get_structure (event);
- if (gst_structure_has_name (s, "GstVaapiEncoderRegionOfInterest")) {
- GstVaapiROI roi;
-
- if (!encode->encoder)
- return TRUE;
-
- if (!gst_structure_get_uint (s, "roi-x", &roi.rect.x) ||
- !gst_structure_get_uint (s, "roi-y", &roi.rect.y) ||
- !gst_structure_get_uint (s, "roi-width", &roi.rect.width) ||
- !gst_structure_get_uint (s, "roi-height", &roi.rect.height) ||
- !gst_structure_get_int (s, "roi-value", &roi.roi_value)) {
- return TRUE;
- }
-
- if (roi.roi_value == 0) {
- ret = gst_vaapi_encoder_del_roi (encode->encoder, &roi);
- if (ret) {
- GST_INFO_OBJECT (venc, "ROI: region with %d/%d/%d/%d is removed",
- roi.rect.x, roi.rect.y, roi.rect.width, roi.rect.height);
- }
- } else {
- ret = gst_vaapi_encoder_add_roi (encode->encoder, &roi);
- if (ret) {
- GST_INFO_OBJECT (venc, "ROI: region with %d/%d/%d/%d is added",
- roi.rect.x, roi.rect.y, roi.rect.width, roi.rect.height);
- }
- }
- gst_event_unref (event);
- return ret;
- }
- break;
- }
- default:
- break;
- }
-
ret = GST_VIDEO_ENCODER_CLASS (gst_vaapiencode_parent_class)->sink_event
(venc, event);
if (!ret)
diff --git a/gst/vaapi/gstvaapiencode_h264.c b/gst/vaapi/gstvaapiencode_h264.c
index f963de94..96e6ef58 100644
--- a/gst/vaapi/gstvaapiencode_h264.c
+++ b/gst/vaapi/gstvaapiencode_h264.c
@@ -58,80 +58,6 @@
* gst-launch-1.0 -ev videotestsrc num-buffers=60 ! timeoverlay ! vaapih264enc ! h264parse ! mp4mux ! filesink location=test.mp4
* ]|
* </refsect2>
- *
- * <refsect2>
- * <title>Region of Interest</title>
- * Since libva supports Region Of Interest for avc encoding depending on H/W,
- * GStreamer VA-API supports it by #GstEvent.
- * To enable ROI, an application must send an event of type GST_EVENT_CUSTOM_DOWNSTREAM,
- * having a structure of name "GstVaapiEncoderRegionOfInterest" with fields set
- * according to the following table:
- *
- * <informaltable>
- * <tgroup cols='3'>
- * <colspec colname='Name' />
- * <colspec colname='Type' />
- * <colspec colname='Purpose' />
- * <thead>
- * <row>
- * <entry>Name</entry>
- * <entry>GType</entry>
- * <entry>Description</entry>
- * </row>
- * </thead>
- * <tbody>
- * <row>
- * <entry>roi-value</entry>
- * <entry>G_TYPE_INT</entry>
- * <entry>specifies ROI delta QP or ROI priority.
- * ROI delta QP is the value that will be added on top of the frame level QP.
- * ROI priority specifies the priority of a region, it can be positive (more important)
- * or negative (less important) values and is compared with non-ROI region (taken as value 0),
- *
- * </entry>
- * </row>
- * <row>
- * <entry>roi-x</entry>
- * <entry>G_TYPE_UINT</entry>
- * <entry>X</entry>
- * </row>
- * <row>
- * <entry>roi-y</entry>
- * <entry>G_TYPE_UINT</entry>
- * <entry>Y</entry>
- * </row>
- * <row>
- * <entry>roi-width</entry>
- * <entry>G_TYPE_UINT</entry>
- * <entry>width</entry>
- * </row>
- * <row>
- * <entry>roi-height</entry>
- * <entry>G_TYPE_UINT</entry>
- * <entry>height</entry>
- * </row>
- * </tbody>
- * </tgroup>
- * </informaltable>
- *
- * For example, the following code informs the encoder to enable ROI
- * with a region for ROI.
- * Note that if an application wants to disable the region,
- * just send an event with roi-value=0 and same coordination.
- *
- * <programlisting>
- * GstEvent *event = gst_event_new_custom (GST_EVENT_CUSTOM_DOWNSTREAM,
- * gst_structure_new ("GstVaapiEncoderRegionOfInterest",
- * "roi-x", G_TYPE_UINT, 1820,
- * "roi-y", G_TYPE_UINT, 980,
- * "roi-width", G_TYPE_UINT, 100,
- * "roi-height", G_TYPE_UINT, 100,
- * "roi-value", G_TYPE_INT, 4, NULL));
- *
- * gst_element_send_event (pipeline, event);
- * </programlisting>
- * </refsect2>
- *
*/
#include "gstcompat.h"