[vlc-commits] npapi: fix vlcpp fetch
vlc/vlc-2.2 | branch: master | Rafaël Carré fun...@videolan.org | Fri Apr 24 15:55:23 2015 +0200| [25028749dc5f86c04a67ae47fccc7d6ad672ee8a] | committer: Jean-Baptiste Kempf npapi: fix vlcpp fetch VLC itself has no submodules (cherry picked from commit 1f51cbc7439fbcd19d8a33c7a2809401951c8f76) Signed-off-by: Jean-Baptiste Kempf j...@videolan.org http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=25028749dc5f86c04a67ae47fccc7d6ad672ee8a --- extras/package/npapi.am |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extras/package/npapi.am b/extras/package/npapi.am index 31b9e89..da8a4f0 100644 --- a/extras/package/npapi.am +++ b/extras/package/npapi.am @@ -11,7 +11,8 @@ fetch-npapi: git reset --hard origin/master; \ git submodule update; \ else \ - git clone git://git.videolan.org/npapi-vlc.git npapi-vlc ; \ + git clone git://git.videolan.org/npapi-vlc.git npapi-vlc \ + cd npapi-vlc \ git submodule update --init; \ fi git --git-dir=npapi-vlc/.git describe --long --always stamp-npapi.tmp ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] stream_filter: httplive: fix delay on eof
vlc/vlc-2.2 | branch: master | Francois Cartegnie fcvlc...@free.fr | Thu Apr 23 15:31:58 2015 +0200| [af1782beffd1a9b365a6189d5e18ed5ed1cc1892] | committer: Jean-Baptiste Kempf stream_filter: httplive: fix delay on eof (cherry picked from commit 169604c5a75b4d9f99a1db8561e6319d6b11bbfb) Signed-off-by: Jean-Baptiste Kempf j...@videolan.org http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=af1782beffd1a9b365a6189d5e18ed5ed1cc1892 --- modules/stream_filter/httplive.c | 16 1 file changed, 16 insertions(+) diff --git a/modules/stream_filter/httplive.c b/modules/stream_filter/httplive.c index 45f908a..e94dad5 100644 --- a/modules/stream_filter/httplive.c +++ b/modules/stream_filter/httplive.c @@ -155,6 +155,7 @@ struct stream_sys_t vlc_mutex_t lock; bool paused; atomic_bool closing; +atomic_bool eof; }; / @@ -1661,6 +1662,13 @@ static void* hls_Thread(void *p_this) (p_sys-download.segment = count)) (p_sys-download.seek == -1)) { + +if(!p_sys-b_live p_sys-download.segment = count) +{ +/* this was last segment to read */ +atomic_store(p_sys-eof, true); +} + vlc_cond_wait(p_sys-download.wait, p_sys-download.lock_wait); if (p_sys-b_live /* (mdate() = p_sys-playlist.wakeup)*/) break; @@ -1672,6 +1680,7 @@ static void* hls_Thread(void *p_this) { p_sys-download.segment = p_sys-download.seek; p_sys-download.seek = -1; +atomic_store(p_sys-eof, false); } vlc_mutex_unlock(p_sys-download.lock_wait); @@ -2065,6 +2074,7 @@ static int Open(vlc_object_t *p_this) p_sys-paused = false; atomic_init(p_sys-closing, false); +atomic_init(p_sys-eof, false); vlc_cond_init(p_sys-wait); vlc_mutex_init(p_sys-lock); @@ -2420,6 +2430,12 @@ static int Read(stream_t *s, void *buffer, unsigned int i_read) // running this read operation is also responsible for closing the stream if (length == 0) { +if(atomic_load(p_sys-eof)) /* finished reading last segment */ +{ +vlc_mutex_unlock(p_sys-read.lock_wait); +return 0; +} + mtime_t start = mdate(); // Wait for 10 seconds ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] mediacodec: don't process output it input failed
vlc | branch: master | Thomas Guillem tho...@gllm.fr | Mon Apr 27 13:43:10 2015 +0200| [c39c4bd3383478a2fcc890ab9c1f0ea8259db9e6] | committer: Thomas Guillem mediacodec: don't process output it input failed http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c39c4bd3383478a2fcc890ab9c1f0ea8259db9e6 --- modules/codec/omxil/android_mediacodec.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/codec/omxil/android_mediacodec.c b/modules/codec/omxil/android_mediacodec.c index cf155dc..7672a2b 100644 --- a/modules/codec/omxil/android_mediacodec.c +++ b/modules/codec/omxil/android_mediacodec.c @@ -1183,7 +1183,7 @@ static picture_t *DecodeVideo(decoder_t *p_dec, block_t **pp_block) if (p_block i_input_ret == 0) i_input_ret = PutInput(p_dec, env, p_block, timeout); -if (i_output_ret == 0) +if (i_input_ret != -1 i_output_ret == 0) { /* FIXME: A new picture shouldn't be created each time. * If decoder_NewPicture fails because the decoder is ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] mediacodec: remove invalid exception check
vlc | branch: master | Thomas Guillem tho...@gllm.fr | Mon Apr 27 14:06:14 2015 +0200| [73d8e11f19944b7279c5ab3ec10ef5c3b90df7a9] | committer: Thomas Guillem mediacodec: remove invalid exception check http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=73d8e11f19944b7279c5ab3ec10ef5c3b90df7a9 --- modules/codec/omxil/android_mediacodec.c |1 - 1 file changed, 1 deletion(-) diff --git a/modules/codec/omxil/android_mediacodec.c b/modules/codec/omxil/android_mediacodec.c index 7672a2b..3e03c33 100644 --- a/modules/codec/omxil/android_mediacodec.c +++ b/modules/codec/omxil/android_mediacodec.c @@ -1094,7 +1094,6 @@ static int GetOutput(decoder_t *p_dec, JNIEnv *env, picture_t *p_pic, jlong time p_sys-stride = width; if (p_sys-slice_height = 0) p_sys-slice_height = height; -CHECK_EXCEPTION(); ArchitectureSpecificCopyHooks(p_dec, p_sys-pixel_format, p_sys-slice_height, p_sys-stride, p_sys-architecture_specific_data); ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] DXVA2: don't use the decoder if the profile is not supported
vlc | branch: master | Steve Lhomme rob...@videolabs.io | Thu Apr 23 09:56:02 2015 +| [bff2ef9d388d6c30e793813cb1a6d69c4eed8471] | committer: Jean-Baptiste Kempf DXVA2: don't use the decoder if the profile is not supported Signed-off-by: Jean-Baptiste Kempf j...@videolan.org http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=bff2ef9d388d6c30e793813cb1a6d69c4eed8471 --- modules/codec/Makefile.am |2 +- modules/codec/avcodec/dxva2.c | 188 ++--- 2 files changed, 120 insertions(+), 70 deletions(-) Diff: http://git.videolan.org/gitweb.cgi/vlc.git/?a=commitdiff;h=bff2ef9d388d6c30e793813cb1a6d69c4eed8471 ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] rdp: Support FreeRDP-1.2.0-beta1-android9
vlc/vlc-2.2 | branch: master | Vinson Lee v...@freedesktop.org | Fri Feb 20 06:05:09 2015 +| [4ddbb29da4c4869dac8b16cd897a682a509b026b] | committer: Jean-Baptiste Kempf rdp: Support FreeRDP-1.2.0-beta1-android9 Fix build errors. CC access/librdp_plugin_la-rdp.lo access/rdp.c: In function ‘Open’: access/rdp.c:431:5: error: implicit declaration of function ‘freerdp_channels_global_init’ [-Werror=implicit-function-declaration] freerdp_channels_global_init(); ^ access/rdp.c: In function ‘Close’: access/rdp.c:507:5: error: implicit declaration of function ‘freerdp_channels_global_uninit’ [-Werror=implicit-function-declaration] freerdp_channels_global_uninit(); ^ freerdp channels global functions were removed from FreeRDP repository in commit 2a82684521dc8b23ae92e284e866227e5194a7bb. commit 2a82684521dc8b23ae92e284e866227e5194a7bb Author: Marc-André Moreau marcandre.mor...@gmail.com Date: Wed Jun 11 16:27:31 2014 -0400 channels: cleanup unused freerdp channels global functions Signed-off-by: Vinson Lee v...@freedesktop.org Signed-off-by: Jean-Baptiste Kempf j...@videolan.org (cherry picked from commit 5c07f87a773153c128b3a771ed61e7915cd8fe18) Signed-off-by: Jean-Baptiste Kempf j...@videolan.org http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=4ddbb29da4c4869dac8b16cd897a682a509b026b --- modules/access/rdp.c |4 1 file changed, 4 insertions(+) diff --git a/modules/access/rdp.c b/modules/access/rdp.c index a7280a59..0a11f42 100644 --- a/modules/access/rdp.c +++ b/modules/access/rdp.c @@ -428,7 +428,9 @@ static int Open( vlc_object_t *p_this ) if ( p_sys-f_fps = 0 ) p_sys-f_fps = 1.0; p_sys-i_frame_interval = 100 / p_sys-f_fps; +#if FREERDP_VERSION_MAJOR == 1 FREERDP_VERSION_MINOR 2 freerdp_channels_global_init(); +#endif p_sys-p_instance = freerdp_new(); if ( !p_sys-p_instance ) @@ -504,7 +506,9 @@ static void Close( vlc_object_t *p_this ) freerdp_disconnect( p_sys-p_instance ); freerdp_free( p_sys-p_instance ); +#if FREERDP_VERSION_MAJOR == 1 FREERDP_VERSION_MINOR 2 freerdp_channels_global_uninit(); +#endif if ( p_sys-p_block ) block_Release( p_sys-p_block ); ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] DXVA2: lock the buffer pool when getting/releasing a buffer
vlc | branch: master | Steve Lhomme rob...@videolabs.io | Thu Apr 23 05:12:12 2015 +| [9a23705530416d30a948c7646c9d9d1ccd866377] | committer: Jean-Baptiste Kempf DXVA2: lock the buffer pool when getting/releasing a buffer Signed-off-by: Jean-Baptiste Kempf j...@videolan.org http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9a23705530416d30a948c7646c9d9d1ccd866377 --- modules/codec/avcodec/dxva2.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/modules/codec/avcodec/dxva2.c b/modules/codec/avcodec/dxva2.c index 9fed97b..cbdda7f 100644 --- a/modules/codec/avcodec/dxva2.c +++ b/modules/codec/avcodec/dxva2.c @@ -311,6 +311,7 @@ typedef struct { LPDIRECT3DSURFACE9 d3d; intrefcount; unsigned int order; +vlc_mutex_t*p_lock; } vlc_va_surface_t; #define VA_DXVA2_MAX_SURFACE_COUNT (64) @@ -320,6 +321,8 @@ struct vlc_va_sys_t int width; int height; +vlc_mutex_t surface_lock; + /* DLL */ HINSTANCE hd3d9_dll; HINSTANCE hdxva2_dll; @@ -507,6 +510,8 @@ static int Get(vlc_va_t *va, picture_t *pic, uint8_t **data) return VLC_EGENERIC; } +vlc_mutex_lock( sys-surface_lock ); + /* Grab an unused surface, in case none are, try the oldest * XXX using the oldest is a workaround in case a problem happens with libavcodec */ unsigned i, old; @@ -528,6 +533,9 @@ static int Get(vlc_va_t *va, picture_t *pic, uint8_t **data) surface-order = sys-surface_order++; *data = (void *)surface-d3d; pic-context = surface; + +vlc_mutex_unlock( sys-surface_lock ); + return VLC_SUCCESS; } @@ -535,11 +543,14 @@ static void Release(void *opaque, uint8_t *data) { picture_t *pic = opaque; vlc_va_surface_t *surface = pic-context; +vlc_mutex_lock( surface-p_lock ); surface-refcount--; pic-context = NULL; picture_Release(pic); (void) data; + +vlc_mutex_unlock( surface-p_lock ); } static void Close(vlc_va_t *va, AVCodecContext *ctx) @@ -557,6 +568,7 @@ static void Close(vlc_va_t *va, AVCodecContext *ctx) FreeLibrary(sys-hdxva2_dll); if (sys-hd3d9_dll) FreeLibrary(sys-hd3d9_dll); +vlc_mutex_destroy( sys-surface_lock ); free((char *)va-description); free(sys); @@ -575,6 +587,8 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt, va-sys = sys; sys-codec_id = ctx-codec_id; +vlc_mutex_init( sys-surface_lock ); + /* Load dll*/ sys-hd3d9_dll = LoadLibrary(TEXT(D3D9.DLL)); if (!sys-hd3d9_dll) { @@ -1018,6 +1032,7 @@ static int DxCreateVideoDecoder(vlc_va_t *va, int codec_id, surface-d3d = sys-hw_surface[i]; surface-refcount = 0; surface-order = 0; +surface-p_lock = sys-surface_lock; } msg_Dbg(va, IDirectXVideoAccelerationService_CreateSurface succeed with %d surfaces (%dx%d), sys-surface_count, fmt-i_width, fmt-i_height); ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] DXVA2: lock the buffer pool when getting/releasing a buffer (v5)
vlc | branch: master | Steve Lhomme rob...@videolabs.io | Thu Apr 23 05:12:12 2015 +| [600e70d255e2a15242ab1ca1eb673c69da33ff1d] | committer: Jean-Baptiste Kempf DXVA2: lock the buffer pool when getting/releasing a buffer (v5) -- replaces v4 aka https://patches.videolan.org/patch/8442/ now the lock is always used even if thread safety is not requested (but it is always requested) Signed-off-by: Jean-Baptiste Kempf j...@videolan.org http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=600e70d255e2a15242ab1ca1eb673c69da33ff1d --- modules/codec/avcodec/dxva2.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/modules/codec/avcodec/dxva2.c b/modules/codec/avcodec/dxva2.c index 9fed97b..cbdda7f 100644 --- a/modules/codec/avcodec/dxva2.c +++ b/modules/codec/avcodec/dxva2.c @@ -311,6 +311,7 @@ typedef struct { LPDIRECT3DSURFACE9 d3d; intrefcount; unsigned int order; +vlc_mutex_t*p_lock; } vlc_va_surface_t; #define VA_DXVA2_MAX_SURFACE_COUNT (64) @@ -320,6 +321,8 @@ struct vlc_va_sys_t int width; int height; +vlc_mutex_t surface_lock; + /* DLL */ HINSTANCE hd3d9_dll; HINSTANCE hdxva2_dll; @@ -507,6 +510,8 @@ static int Get(vlc_va_t *va, picture_t *pic, uint8_t **data) return VLC_EGENERIC; } +vlc_mutex_lock( sys-surface_lock ); + /* Grab an unused surface, in case none are, try the oldest * XXX using the oldest is a workaround in case a problem happens with libavcodec */ unsigned i, old; @@ -528,6 +533,9 @@ static int Get(vlc_va_t *va, picture_t *pic, uint8_t **data) surface-order = sys-surface_order++; *data = (void *)surface-d3d; pic-context = surface; + +vlc_mutex_unlock( sys-surface_lock ); + return VLC_SUCCESS; } @@ -535,11 +543,14 @@ static void Release(void *opaque, uint8_t *data) { picture_t *pic = opaque; vlc_va_surface_t *surface = pic-context; +vlc_mutex_lock( surface-p_lock ); surface-refcount--; pic-context = NULL; picture_Release(pic); (void) data; + +vlc_mutex_unlock( surface-p_lock ); } static void Close(vlc_va_t *va, AVCodecContext *ctx) @@ -557,6 +568,7 @@ static void Close(vlc_va_t *va, AVCodecContext *ctx) FreeLibrary(sys-hdxva2_dll); if (sys-hd3d9_dll) FreeLibrary(sys-hd3d9_dll); +vlc_mutex_destroy( sys-surface_lock ); free((char *)va-description); free(sys); @@ -575,6 +587,8 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt, va-sys = sys; sys-codec_id = ctx-codec_id; +vlc_mutex_init( sys-surface_lock ); + /* Load dll*/ sys-hd3d9_dll = LoadLibrary(TEXT(D3D9.DLL)); if (!sys-hd3d9_dll) { @@ -1018,6 +1032,7 @@ static int DxCreateVideoDecoder(vlc_va_t *va, int codec_id, surface-d3d = sys-hw_surface[i]; surface-refcount = 0; surface-order = 0; +surface-p_lock = sys-surface_lock; } msg_Dbg(va, IDirectXVideoAccelerationService_CreateSurface succeed with %d surfaces (%dx%d), sys-surface_count, fmt-i_width, fmt-i_height); ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] NPAPI: call git submodule when cloning
vlc/vlc-2.2 | branch: master | Jean-Baptiste Kempf j...@videolan.org | Tue Apr 21 11:16:12 2015 +0200| [4d36ec4832227c384c3fa50fed431189a8b87080] | committer: Jean-Baptiste Kempf NPAPI: call git submodule when cloning (cherry picked from commit 98ec9654ec890b7decf9472cade61c82f489aa9e) Signed-off-by: Jean-Baptiste Kempf j...@videolan.org http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=4d36ec4832227c384c3fa50fed431189a8b87080 --- extras/package/npapi.am |2 ++ 1 file changed, 2 insertions(+) diff --git a/extras/package/npapi.am b/extras/package/npapi.am index e778f7d..31b9e89 100644 --- a/extras/package/npapi.am +++ b/extras/package/npapi.am @@ -9,8 +9,10 @@ fetch-npapi: cd npapi-vlc \ git fetch origin \ git reset --hard origin/master; \ + git submodule update; \ else \ git clone git://git.videolan.org/npapi-vlc.git npapi-vlc ; \ + git submodule update --init; \ fi git --git-dir=npapi-vlc/.git describe --long --always stamp-npapi.tmp if diff stamp-npapi.tmp stamp-npapi /dev/null 21; then \ ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] avcodec: pass a dummy picture_sys_t to the va decoder Open()
vlc | branch: master | Steve Lhomme rob...@videolabs.io | Mon Apr 27 14:26:35 2015 +0200| [810104cae0ad4e33f547a8a015defa9a13cc974e] | committer: Jean-Baptiste Kempf avcodec: pass a dummy picture_sys_t to the va decoder Open() may share some resources between the decoder pool pictures and the va. Signed-off-by: Rémi Denis-Courmont r...@remlab.net http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=810104cae0ad4e33f547a8a015defa9a13cc974e --- modules/codec/avcodec/dxva2.c |6 -- modules/codec/avcodec/va.c| 10 ++ modules/codec/avcodec/va.h|3 ++- modules/codec/avcodec/vaapi.c |3 ++- modules/codec/avcodec/vda.c |8 +--- modules/codec/avcodec/video.c |7 ++- modules/hw/vdpau/avcodec.c|3 ++- 7 files changed, 27 insertions(+), 13 deletions(-) diff --git a/modules/codec/avcodec/dxva2.c b/modules/codec/avcodec/dxva2.c index cbdda7f..81c2a9c 100644 --- a/modules/codec/avcodec/dxva2.c +++ b/modules/codec/avcodec/dxva2.c @@ -54,7 +54,7 @@ #include ../h264_nal.h static int Open(vlc_va_t *, AVCodecContext *, enum PixelFormat, -const es_format_t *); +const es_format_t *, picture_sys_t *p_sys); static void Close(vlc_va_t *, AVCodecContext *); vlc_module_begin() @@ -575,11 +575,13 @@ static void Close(vlc_va_t *va, AVCodecContext *ctx) } static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt, -const es_format_t *fmt) +const es_format_t *fmt, picture_sys_t *p_sys) { if (pix_fmt != AV_PIX_FMT_DXVA2_VLD) return VLC_EGENERIC; +(void) p_sys; + vlc_va_sys_t *sys = calloc(1, sizeof (*sys)); if (unlikely(sys == NULL)) return VLC_ENOMEM; diff --git a/modules/codec/avcodec/va.c b/modules/codec/avcodec/va.c index 2da49ce..413574d 100644 --- a/modules/codec/avcodec/va.c +++ b/modules/codec/avcodec/va.c @@ -75,10 +75,11 @@ static int vlc_va_Start(void *func, va_list ap) AVCodecContext *ctx = va_arg(ap, AVCodecContext *); enum PixelFormat pix_fmt = va_arg(ap, enum PixelFormat); const es_format_t *fmt = va_arg(ap, const es_format_t *); +picture_sys_t *p_sys = va_arg(ap, picture_sys_t *); int (*open)(vlc_va_t *, AVCodecContext *, enum PixelFormat, -const es_format_t *) = func; +const es_format_t *, picture_sys_t *) = func; -return open(va, ctx, pix_fmt, fmt); +return open(va, ctx, pix_fmt, fmt, p_sys); } static void vlc_va_Stop(void *func, va_list ap) @@ -91,14 +92,15 @@ static void vlc_va_Stop(void *func, va_list ap) } vlc_va_t *vlc_va_New(vlc_object_t *obj, AVCodecContext *avctx, - enum PixelFormat pix_fmt, const es_format_t *fmt) + enum PixelFormat pix_fmt, const es_format_t *fmt, + picture_sys_t *p_sys) { vlc_va_t *va = vlc_object_create(obj, sizeof (*va)); if (unlikely(va == NULL)) return NULL; va-module = vlc_module_load(va, hw decoder, $avcodec-hw, true, - vlc_va_Start, va, avctx, pix_fmt, fmt); + vlc_va_Start, va, avctx, pix_fmt, fmt, p_sys); if (va-module == NULL) { vlc_object_release(va); diff --git a/modules/codec/avcodec/va.h b/modules/codec/avcodec/va.h index fe5b947..5c4b11d 100644 --- a/modules/codec/avcodec/va.h +++ b/modules/codec/avcodec/va.h @@ -58,7 +58,8 @@ vlc_fourcc_t vlc_va_GetChroma(enum PixelFormat hwfmt, enum PixelFormat swfmt); * @return a new VLC object on success, NULL on error. */ vlc_va_t *vlc_va_New(vlc_object_t *obj, AVCodecContext *, - enum PixelFormat, const es_format_t *fmt); + enum PixelFormat, const es_format_t *fmt, + picture_sys_t *p_sys); /** * Initializes the acceleration video decoding back-end for libavcodec. diff --git a/modules/codec/avcodec/vaapi.c b/modules/codec/avcodec/vaapi.c index abc452f..4683648 100644 --- a/modules/codec/avcodec/vaapi.c +++ b/modules/codec/avcodec/vaapi.c @@ -291,12 +291,13 @@ static int FindFormat(vlc_va_sys_t *sys) } static int Create( vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt, - const es_format_t *fmt ) + const es_format_t *fmt, picture_sys_t *p_sys ) { if( pix_fmt != AV_PIX_FMT_VAAPI_VLD ) return VLC_EGENERIC; (void) fmt; +(void) p_sys; #ifdef VLC_VA_BACKEND_XLIB if( !vlc_xlib_init( VLC_OBJECT(va) ) ) { diff --git a/modules/codec/avcodec/vda.c b/modules/codec/avcodec/vda.c index 58173c7..6f8105d 100644 --- a/modules/codec/avcodec/vda.c +++ b/modules/codec/avcodec/vda.c @@ -45,7 +45,7 @@ #pragma mark prototypes and definitions static int Open( vlc_va_t *, AVCodecContext *, enum PixelFormat, - const es_format_t * ); + const es_format_t *, picture_sys_t * ); static void Close( vlc_va_t * , AVCodecContext *); static
[vlc-commits] avcodec: missing lock in get_format()
vlc | branch: master | Rémi Denis-Courmont r...@remlab.net | Mon Apr 27 19:24:05 2015 +0300| [e6d165e33020a6391da9a2479439785c1fd6faf2] | committer: Rémi Denis-Courmont avcodec: missing lock in get_format() Pointed-out-by: Thomas Guillem tho...@gllm.fr http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e6d165e33020a6391da9a2479439785c1fd6faf2 --- modules/codec/avcodec/video.c |5 + 1 file changed, 5 insertions(+) diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c index 75f1132..89bdbcb 100644 --- a/modules/codec/avcodec/video.c +++ b/modules/codec/avcodec/video.c @@ -1122,6 +1122,8 @@ static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_context, if (!can_hwaccel) return swfmt; +wait_mt(p_sys); + for( size_t i = 0; pi_fmt[i] != PIX_FMT_NONE; i++ ) { enum PixelFormat hwfmt = pi_fmt[i]; @@ -1147,6 +1149,8 @@ static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_context, continue; } +post_mt(p_sys); + if (va-description != NULL) msg_Info(p_dec, Using %s for hardware decoding, va-description); @@ -1159,6 +1163,7 @@ static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_context, return pi_fmt[i]; } +post_mt(p_sys); /* Fallback to default behaviour */ return swfmt; } ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] avcodec: pass a dummy picture_sys_t to the va decoder Open() (v2)
vlc | branch: master | Steve Lhomme rob...@videolabs.io | Mon Apr 27 14:26:35 2015 +0200| [a92a696a9baa9481c93a2285b60ae663ec33e298] | committer: Rémi Denis-Courmont avcodec: pass a dummy picture_sys_t to the va decoder Open() (v2) may share some resources between the decoder pool pictures and the va. -- v1 used const on the picture_sys_t that may be modified Signed-off-by: Rémi Denis-Courmont r...@remlab.net http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a92a696a9baa9481c93a2285b60ae663ec33e298 --- modules/codec/avcodec/dxva2.c |6 -- modules/codec/avcodec/va.c| 10 ++ modules/codec/avcodec/va.h|3 ++- modules/codec/avcodec/vaapi.c |3 ++- modules/codec/avcodec/vda.c |6 -- modules/codec/avcodec/video.c |7 ++- modules/hw/vdpau/avcodec.c|3 ++- 7 files changed, 26 insertions(+), 12 deletions(-) diff --git a/modules/codec/avcodec/dxva2.c b/modules/codec/avcodec/dxva2.c index cbdda7f..81c2a9c 100644 --- a/modules/codec/avcodec/dxva2.c +++ b/modules/codec/avcodec/dxva2.c @@ -54,7 +54,7 @@ #include ../h264_nal.h static int Open(vlc_va_t *, AVCodecContext *, enum PixelFormat, -const es_format_t *); +const es_format_t *, picture_sys_t *p_sys); static void Close(vlc_va_t *, AVCodecContext *); vlc_module_begin() @@ -575,11 +575,13 @@ static void Close(vlc_va_t *va, AVCodecContext *ctx) } static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt, -const es_format_t *fmt) +const es_format_t *fmt, picture_sys_t *p_sys) { if (pix_fmt != AV_PIX_FMT_DXVA2_VLD) return VLC_EGENERIC; +(void) p_sys; + vlc_va_sys_t *sys = calloc(1, sizeof (*sys)); if (unlikely(sys == NULL)) return VLC_ENOMEM; diff --git a/modules/codec/avcodec/va.c b/modules/codec/avcodec/va.c index 2da49ce..413574d 100644 --- a/modules/codec/avcodec/va.c +++ b/modules/codec/avcodec/va.c @@ -75,10 +75,11 @@ static int vlc_va_Start(void *func, va_list ap) AVCodecContext *ctx = va_arg(ap, AVCodecContext *); enum PixelFormat pix_fmt = va_arg(ap, enum PixelFormat); const es_format_t *fmt = va_arg(ap, const es_format_t *); +picture_sys_t *p_sys = va_arg(ap, picture_sys_t *); int (*open)(vlc_va_t *, AVCodecContext *, enum PixelFormat, -const es_format_t *) = func; +const es_format_t *, picture_sys_t *) = func; -return open(va, ctx, pix_fmt, fmt); +return open(va, ctx, pix_fmt, fmt, p_sys); } static void vlc_va_Stop(void *func, va_list ap) @@ -91,14 +92,15 @@ static void vlc_va_Stop(void *func, va_list ap) } vlc_va_t *vlc_va_New(vlc_object_t *obj, AVCodecContext *avctx, - enum PixelFormat pix_fmt, const es_format_t *fmt) + enum PixelFormat pix_fmt, const es_format_t *fmt, + picture_sys_t *p_sys) { vlc_va_t *va = vlc_object_create(obj, sizeof (*va)); if (unlikely(va == NULL)) return NULL; va-module = vlc_module_load(va, hw decoder, $avcodec-hw, true, - vlc_va_Start, va, avctx, pix_fmt, fmt); + vlc_va_Start, va, avctx, pix_fmt, fmt, p_sys); if (va-module == NULL) { vlc_object_release(va); diff --git a/modules/codec/avcodec/va.h b/modules/codec/avcodec/va.h index fe5b947..5c4b11d 100644 --- a/modules/codec/avcodec/va.h +++ b/modules/codec/avcodec/va.h @@ -58,7 +58,8 @@ vlc_fourcc_t vlc_va_GetChroma(enum PixelFormat hwfmt, enum PixelFormat swfmt); * @return a new VLC object on success, NULL on error. */ vlc_va_t *vlc_va_New(vlc_object_t *obj, AVCodecContext *, - enum PixelFormat, const es_format_t *fmt); + enum PixelFormat, const es_format_t *fmt, + picture_sys_t *p_sys); /** * Initializes the acceleration video decoding back-end for libavcodec. diff --git a/modules/codec/avcodec/vaapi.c b/modules/codec/avcodec/vaapi.c index abc452f..4683648 100644 --- a/modules/codec/avcodec/vaapi.c +++ b/modules/codec/avcodec/vaapi.c @@ -291,12 +291,13 @@ static int FindFormat(vlc_va_sys_t *sys) } static int Create( vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt, - const es_format_t *fmt ) + const es_format_t *fmt, picture_sys_t *p_sys ) { if( pix_fmt != AV_PIX_FMT_VAAPI_VLD ) return VLC_EGENERIC; (void) fmt; +(void) p_sys; #ifdef VLC_VA_BACKEND_XLIB if( !vlc_xlib_init( VLC_OBJECT(va) ) ) { diff --git a/modules/codec/avcodec/vda.c b/modules/codec/avcodec/vda.c index 58173c7..16a63e8 100644 --- a/modules/codec/avcodec/vda.c +++ b/modules/codec/avcodec/vda.c @@ -45,7 +45,7 @@ #pragma mark prototypes and definitions static int Open( vlc_va_t *, AVCodecContext *, enum PixelFormat, - const es_format_t * ); + const es_format_t *, picture_sys_t *