summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-01-03libs: encoder: modify 265 VPS header fields.He Junyan1-2/+6
vps_base_layer_internal_flag and vps_base_layer_available_flag have been clearly defined now.
2020-01-03libs: display: fix a resource leak in X11 pixmap format.He Junyan1-0/+1
2020-01-02libs: utils: delete useless gst_vaapi_profile_caps_append_encoder.Víctor Manuel Jáquez Leal2-34/+0
2020-01-02libs: encoder: get surfaces resolution the same time with formats.He Junyan3-70/+92
We can get all the information about the video format at one shot when we create the test context for getting the supported formats. The current way to get the width and height ranges are inefficient, since it calls the function gst_vaapi_profile_caps_append_encoder() and it creates another temporal context to detect the resolution information. Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
2019-12-29libs: encoder: vp9: fix code styleVíctor Manuel Jáquez Leal1-2/+2
2019-12-29libs: encoder: set entrypoint based on tune automaticallyHe Junyan5-18/+82
Some profile, such as H265_MAIN_444 on new Intel platform, may only support ENTRYPOINT_SLICE_ENCODE_LP entrypoint. This leads two problems: 1. We need to specify the tune mode like `vaapih265enc tune=low-power` every time when we need to use this kind of profile. Or we can not create the encoder context successfully. 2. More seriously, we set the entrypoint to a fixed value in init_context_info() and so the create_test_context_config() can not create the test context for these profile and can not get the supported video formats, either. We now change the entrypoint setting based on the tune option of the encoder. If no tune property provided, we just choose the first available entrypoint.
2019-12-29libs: encoder: set context info profile by encoderHe Junyan7-16/+23
Instead of init_context_info() setting the passed profile, it is assumed that it has to be set by each encoder. Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
2019-12-29libs: context: add invalid entrypoint symbolHe Junyan2-4/+13
The symbol GST_VAAPI_ENTRYPOINT_INVALID is just a representation of zero, which was already used as an invalid value tacitly. This patch only makes it explicit. Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
2019-12-29libs: pixmap: Fix a pixmap creation crash.He Junyan1-1/+1
We use GST_VAAPI_OBJECT_NATIVE_DISPLAY with wrong parameter for x11 pixmap creation, which causes crash if we run the internal test case of: test-decode --pixmap
2019-12-23plugin: encode: set allowed_sinkpad_caps to empty.He Junyan1-0/+3
We now set encode->allowed_sinkpad_caps to NULL if we fail to get surfaces formats. This causes two problem: 1. gst_video_encoder_proxy_getcaps use NULL as its caps parameter, which changes its behavior. It will use encode's sinkpad template rather than empty caps to do the clip job. So even if we fail to set allowed_sinkpad_caps, gst_video_encoder_proxy_getcaps can still return valid caps. 2. We should just set the allowed_sinkpad_caps once. The NULL point make the ensure_allowed_sinkpad_caps function works again and again.
2019-12-22libs: encoder: Add NULL pointer check for context when finalize.He Junyan1-1/+2
Context may be NULL if pipeline fail in early stage, and the ensure_context will not be called. Need to add a pointer protection for it.
2019-12-20plugins: base: do not reset can_dmabufU. Artie Eoff1-1/+0
Don't reset the can_dmabuf field. This restores the close/reset logic that existed prior to commit ca2942176b5632e07eebac23336954f9aaf1cb26 in regards to dmabuf support. Plugins only call gst_vaapi_plugin_base_set_srcpad_can_dmabuf once during startup, but may need to reset the other private fields multiple times during negotiation. Thus, can_dmabuf should be exempt from the resets. Fixes #208
2019-12-20plugin: encode: Refine encode's sink caps.He Junyan1-13/+19
The old manner to get the encode's sink caps is not correct. Such as 264 encode, it gets: video/x-raw(memory:VASurface), format=(string){ ENCODED, NV12, I420, YV12, YUY2, UYVY, Y210, P010_10LE, AYUV, Y410, Y444 }, width=(int)[ 32, 4096 ], height=(int)[ 32, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw(memory:DMABuf), format=(string){ I420, YV12, RGBA }, width=(int)[ 32, 4096 ], height=(int)[ 32, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw, format=(string){ NV12 }, width=(int)[ 32, 4096 ], height=(int)[ 32, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ] where the formats for memory:VASurface and memory:DMABuf are superfluous. All the "I420, YV12, YUY2, UYVY, Y210, RGBA" can not be really used as input format for encoder. We should get: video/x-raw, format=(string){ NV12 }, width=(int)[ 32, 4096 ], height=(int)[ 32, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw(memory:VASurface), format=(string){ NV12 }, width=(int)[ 32, 4096 ], height=(int)[ 32, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw(memory:DMABuf), format=(string){ NV12 }, width=(int)[ 32, 4096 ], height=(int)[ 32, 4096 ], framerate=(fraction)[ 0/1, 2147483647/1 ] as the correct result.
2019-12-20libs: display: code clean upVíctor Manuel Jáquez Leal2-20/+24
2019-12-20libs: display: refine the profile/entrypoint map.He Junyan3-49/+64
The old way make the one config for each profile/entrypoint pair, which is not very convenient for description the relationship between them. One profile may contain more than one entrypoints to within it, so a set like data structure should be more suitable.
2019-12-20libs: surface: port to GstMiniObjectHe Junyan28-150/+205
GstVaapiMiniObject and GstVaapiObject are deprecated. This is the first step to remove them by porting GstVaapiSurface as a GstMiniBuffer descendant. Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
2019-12-20libs: surface: rename create function names to initVíctor Manuel Jáquez Leal1-8/+8
There are several internal functions with 'create' name, but they don't create any new structure, but rather it initializes that structure. Renaming those function to reflect better their purpose.
2019-12-20libs: surface: use macro accessorsVíctor Manuel Jáquez Leal1-22/+24
2019-12-20libs: surface: fix internal documentationVíctor Manuel Jáquez Leal1-4/+4
2019-12-20libs: codedbuffer: port to GstMiniObjectHe Junyan14-49/+98
GstVaapiMiniObject and GstVaapiObject are deprecated. This is the first step to remove them by porting GstVaapiCodedBuffer as a GstMiniBuffer descendant. Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
2019-12-20libs: image: port to GstMiniObject base classHe Junyan16-74/+175
GstVaapiMiniObject and GstVaapiObject are deprecrated. This is the first step to remove them, by porting GstVaapiImage as a GstMiniObject. Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
2019-12-20libs: context: port to a plain C structureHe Junyan8-50/+91
The GstVaapiMiniObject is obsolete and we need to replace it. This patch turns GstVaapiContext into a plain C structure with its own reference counting mechanism. Also this patch removes unused overlays attributes. Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
2019-12-18plugin: encode: change the dmabuf caps to all supported formats.He Junyan7-7/+7
The encode's dmabuf caps definition is obsolete, it can support more formats now. Re-define it to include all supported formats in video format map.
2019-12-17libs: encoder: h264fei: remove unnecessary checkVíctor Manuel Jáquez Leal1-2/+3
Issue detected by Coverity `info_to_pack.h264_slice_header` is always allocated by gst_vaapi_feipak_h264_encode(), thus checking it to free it afterwards in doesn't make much sense. But it requires to be free on the error path. There may be a null pointer dereference, or else the comparison against null is unnecessary. In gst_vaapi_encoder_h264_fei_encode: All paths that lead to this null pointer comparison already dereference the pointer earlier
2019-12-17libs: encoder: h264fei: remove unnecessary assertVíctor Manuel Jáquez Leal1-1/+1
Issue detected by Coverity An unsigned value can never be negative, so this test will always evaluate the same way. In add_slice_headers: An unsigned value can never be less than 0
2019-12-17libs: encoder: h264fei: remove unnecessary checkVíctor Manuel Jáquez Leal1-3/+2
Issue detected by Coverity There may be a null pointer dereference, or else the comparison against null is unnecessary. In gst_vaapi_encoder_h264_fei_encode: All paths that lead to this null pointer comparison already dereference the pointer earlier
2019-12-17libs: encoder: h264fei: don't free memory on stackVíctor Manuel Jáquez Leal2-2/+1
Issue detected by Coverity `info_to_pak` variable in gst_vaapi_encoder_h264_fei_encode() is declared in the stack, but it is free in gst_vaapi_feienc_h264_encode() as if declared on the heap. This patch initializes the structure and removes the free. A non-heap pointer is placed on the free list, likely causing a crash later. In gst_vaapi_encoder_h264_fei_encode: Free of an address-of expression, which can never be heap allocated.
2019-12-17libs: encoder: h264fei: fix surface leakVíctor Manuel Jáquez Leal1-1/+3
Issue detected by Coverity If the FEI mode is not handled the created resources should be released and return and error code. The system resource will not be reclaimed and reused, reducing the future availability of the resource. In gst_vaapi_encoder_h264_fei_encode: Leak of memory or pointers to system resources
2019-12-17tests: check return calling of gst_navigation_event_parse.*Víctor Manuel Jáquez Leal1-5/+10
This issue was detected by Coverity. If the function returns an error value, the error value may be mistaken for a normal value. In cb_mouse_event: Value returned from a function is not checked for errors before being used
2019-12-16plugin: encode: set sink's raw caps to GST_VAAPI_FORMATS_ALL.He Junyan7-7/+7
Then encode plugin just supports raw formats declared in vaapi video format map. This modification makes the template caps more precise.
2019-12-11plugins: base: add GstPad param to internal helper functionsU. Artie Eoff1-61/+83
The base plugin public API function implementations determine which pad should be passed to the internal helper functions. Currently, only the base plugin static sinkpad and static srcpad are supported/used. However, this change enables future API functions to be added that can accept a pad (i.e. request pad) from an element subclass (e.g. a GstVideoAggregator subclass).
2019-12-11plugins: base: manage pad-specific data in a single structU. Artie Eoff2-119/+194
Define a struct (GstVaapiPadPrivate) to encapsulate the pad-specific data (i.e. buffer pool, allocator, info, caps, etc.). Add an interface to retrieve the data struct for a given pad. Finally, update the base plugin to use the data struct throughout the implementation. This will enable us to easily extend the base plugin in the future to allow for N-to-1 pad subclasses (e.g. overlay/ composite).
2019-12-11plugins: use plugin base macros to access pad specific dataU. Artie Eoff4-9/+22
Don't access base struct fields directly since the underlying definition can change. Instead, use the accessor macros.
2019-12-11libs: decoder: Modify decode src's template raw formatsHe Junyan1-1/+1
We do not need to maintain a standalone list of decoder's output template for raw formats and that is easy to make mistake(for example, the AYVU is wrong in that list, should be VUYA). Just use GST_VAAPI_FORMATS_ALL to replace the raw formats list for src template.
2019-12-11libs: postproc: Modify src/sink template raw formatsHe Junyan1-2/+2
We need to provide more precise template caps for postproc's src and sink pads. The GST_VIDEO_FORMATS_ALL make all video formats available which are really superfluous.
2019-12-10Do not mix declaration and codeThibault Saunier1-1/+1
2019-11-29libs: decoder: h265: skip all pictures prior the first I-frameVíctor Manuel Jáquez Leal1-1/+23
Don't try to decode until the first I-frame is received within the currently active sequence. i965 H265 decoder don't show any artifact but it crashes. Fixes: #98
2019-11-27libs: video-format: remove dead codeVíctor Manuel Jáquez Leal1-6/+0
2019-11-27libs: video-format: add GST_VAAPI_FORMATS_ALLHe Junyan3-7/+15
GST_VAAPI_FORMATS_ALL collects all declared formats in video-format as a caps template string, and make them available in caps with memory:VASurface feature. Fixes: #199
2019-11-06libs: video-format: change GST_VIDEO_FORMAT_AYUV to VUYA.He Junyan2-2/+2
We only support VUYA format in gst vaapi now, need to correct the mapping.
2019-10-16tests: check: vaapipostproc test_orientation_mouse_eventsU. Artie Eoff1-0/+106
Test that vaapipostproc properly translates mouse events when using video-direction (orientation).
2019-10-16tests: check: vaapipostproc test_crop_mouse_eventsU. Artie Eoff2-1/+230
Test that vaapipostproc properly translates mouse events when cropping.
2019-10-16tests: check: initial unit test supportU. Artie Eoff5-0/+94
Add minimal unit test toolchain files and a simple vaapipostproc unit test.
2019-10-16tests: move examples and tests to subfoldersU. Artie Eoff42-85/+85
This makes way for adding unit (check) tests.
2019-10-14Remove autotools buildTim-Philipp Müller14-2224/+0
2019-10-11vaapipostproc: fix off-by-one coord translationsU. Artie Eoff1-8/+8
When translating navigation x,y coordinates for video-direction, it is necessary to subtract 1 when using the video dimensions to compute the new x,y coordinates. That is, a 100x200 image should map coordinates in x=[0-99],y=[0-199]. This issue was found with unit tests provided in !182.
2019-10-11libs: window: x11: Avoid usage of deprecated APIVíctor Manuel Jáquez Leal1-6/+2
2019-10-11build: halt meson configuration if no renderer APIVíctor Manuel Jáquez Leal1-0/+4
We should halt meson configuration if there is no render API installed (either DRM, Wayland or X11). That behavior was already in autotools but missed in meson. This patch brings it back. Fixes: #196
2019-10-09libs: filter: fix default orientation regressionU. Artie Eoff1-1/+1
Fix regression introduced in f232f87f7082
2019-10-08libs: filter: use OP_DATA_DEFAULT_VALUE macroU. Artie Eoff1-43/+12