Projects
Staging
vlc-beta
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 189
View file
_service:obs_scm:vlc-beta-20220206.71a389dfe1.obscpio/doc/libvlc/gtk_player.c -> _service:obs_scm:vlc-beta-20220209.5820200442.obscpio/doc/libvlc/gtk_player.c
Changed
@@ -1,4 +1,4 @@ -// gcc -o gtk_player gtk_player.c `pkg-config --libs gtk+-2.0 libvlc` `pkg-config --cflags gtk+-2.0 libvlc` +// gcc -o gtk_player gtk_player.c `pkg-config --libs gtk+-3.0 libvlc` `pkg-config --cflags gtk+-3.0 libvlc` /* License WTFPL http://sam.zoy.org/wtfpl/ */ /* Written by Vincent Schüßler */ @@ -105,7 +105,7 @@ filemenu_openitem = gtk_menu_item_new_with_label("Open"); gtk_menu_shell_append(GTK_MENU_SHELL(filemenu), filemenu_openitem); gtk_menu_item_set_submenu(GTK_MENU_ITEM(fileitem), filemenu); - gtk_menu_bar_append(GTK_MENU_BAR(menubar), fileitem); + gtk_menu_shell_append(GTK_MENU_BAR(menubar), fileitem); gtk_box_pack_start(GTK_BOX(vbox), menubar, FALSE, FALSE, 0); g_signal_connect(filemenu_openitem, "activate", G_CALLBACK(on_open), window);
View file
_service:obs_scm:vlc-beta-20220206.71a389dfe1.obscpio/modules/codec/gstreamer/gstdecode.c -> _service:obs_scm:vlc-beta-20220209.5820200442.obscpio/modules/codec/gstreamer/gstdecode.c
Changed
@@ -380,6 +380,9 @@ case VLC_CODEC_VP9: p_str = gst_structure_new_empty( "video/x-vp9" ); break; + case VLC_CODEC_AV1: + p_str = gst_structure_new_empty( "video/x-av1" ); + break; case VLC_CODEC_MPGV: p_str = gst_structure_new_empty( "video/mpeg" ); gst_structure_set( p_str, "mpegversion", G_TYPE_INT, 2,
View file
_service:obs_scm:vlc-beta-20220206.71a389dfe1.obscpio/modules/codec/hxxx_helper_testdec.c -> _service:obs_scm:vlc-beta-20220209.5820200442.obscpio/modules/codec/hxxx_helper_testdec.c
Changed
@@ -154,5 +154,6 @@ add_shortcut("hxxxhelper") set_capability("video decoder", 0) add_bool("hxxx-helper-testdec-xvcC", false, NULL, NULL) + change_volatile() set_callbacks(OpenDecoder, CloseDecoder) vlc_module_end()
View file
_service:obs_scm:vlc-beta-20220206.71a389dfe1.obscpio/modules/codec/jpeg.c -> _service:obs_scm:vlc-beta-20220209.5820200442.obscpio/modules/codec/jpeg.c
Changed
@@ -691,6 +691,21 @@ jpeg_start_compress(&p_sys->p_jpeg, TRUE); + unsigned char exif[] = "Exif\x00\x00" + "\x4d\x4d\x00\x2a" /* TIFF BE header */ + "\x00\x00\x00\x08" /* IFD0 offset */ + "\x00\x01" /* IFD0 tags count */ + "\x01\x12" /* tagtype */ + "\x00\x03" /* value type (x03 == short) */ + "\x00\x00\x00\x01" /* value count */ + "\xFF\xFF\x00\x00" /* value if <= 4 bytes or value offset */ + "\x00\x00\x00\x00" /* 0 last IFD */ + "\x00\x00\x00\x00" /* 0 last IFD offset */ + ; + exif[24] = 0x00; + exif[25] = ORIENT_TO_EXIF(p_pic->format.orientation); + jpeg_write_marker(&p_sys->p_jpeg, JPEG_APP0 + 1, exif, sizeof(exif) - 1); + /* Encode picture */ p_row_pointers = vlc_alloc(p_pic->i_planes, sizeof(JSAMPARRAY)); if (p_row_pointers == NULL)
View file
_service:obs_scm:vlc-beta-20220206.71a389dfe1.obscpio/modules/codec/mft.cpp -> _service:obs_scm:vlc-beta-20220209.5820200442.obscpio/modules/codec/mft.cpp
Changed
@@ -74,10 +74,16 @@ typedef HRESULT (WINAPI *pf_MFCreateDXGIDeviceManager)(UINT *, IMFDXGIDeviceManager **); -struct decoder_sys_t +class mft_dec_sys_t { +public: ComPtr<IMFTransform> mft; + ~mft_dec_sys_t() + { + assert(!streamStarted); + } + const GUID* major_type = nullptr; const GUID* subtype = nullptr; /* Container for a dynamically constructed subtype */ @@ -85,10 +91,10 @@ // Direct3D vlc_video_context *vctx_out = nullptr; - HRESULT (WINAPI *fptr_MFCreateDXGIDeviceManager)(UINT *resetToken, IMFDXGIDeviceManager **ppDeviceManager); + HRESULT (WINAPI *fptr_MFCreateDXGIDeviceManager)(UINT *resetToken, IMFDXGIDeviceManager **ppDeviceManager) = nullptr; UINT dxgi_token = 0; ComPtr<IMFDXGIDeviceManager> dxgi_manager; - HANDLE d3d_handle = 0; + HANDLE d3d_handle = INVALID_HANDLE_VALUE; // D3D11 ComPtr<ID3D11Texture2D> cached_tex; @@ -130,18 +136,48 @@ return false; } - void DoRelease() + /// Required for Async MFTs + HRESULT startStream() + { + assert(!streamStarted); + HRESULT hr = mft->ProcessMessage(MFT_MESSAGE_NOTIFY_START_OF_STREAM, (ULONG_PTR)0); + if (SUCCEEDED(hr)) + streamStarted = true; + return hr; + } + /// Used for Async MFTs + HRESULT endStream() { - mft->SetInputType(input_stream_id, nullptr, 0); - mft->SetOutputType(output_stream_id, nullptr, 0); + assert(streamStarted); + HRESULT hr = mft->ProcessMessage(MFT_MESSAGE_NOTIFY_END_OF_STREAM, (ULONG_PTR)0); + if (SUCCEEDED(hr)) + streamStarted = false; + return hr; + } + + HRESULT flushStream() + { + HRESULT hr = mft->ProcessMessage(MFT_MESSAGE_COMMAND_FLUSH, 0); + if (SUCCEEDED(hr)) + streamStarted = false; + return hr; + } + +private: + void DoRelease() + { if (output_sample.Get()) output_sample->RemoveAllBuffers(); - if (vctx_out) - mft->ProcessMessage(MFT_MESSAGE_SET_D3D_MANAGER, (ULONG_PTR)0); + if (mft.Get()) + { + // mft->SetInputType(input_stream_id, nullptr, 0); + // mft->SetOutputType(output_stream_id, nullptr, 0); - endStreaming(); + if (vctx_out) + mft->ProcessMessage(MFT_MESSAGE_SET_D3D_MANAGER, (ULONG_PTR)0); + } for (size_t i=0; i < ARRAY_SIZE(cachedSRV); i++) { @@ -154,7 +190,7 @@ if (vctx_out && dxgi_manager.Get()) { - if (d3d_handle) + if (d3d_handle != INVALID_HANDLE_VALUE) dxgi_manager->CloseDeviceHandle(d3d_handle); } @@ -166,54 +202,14 @@ MFShutdown(); } - bool isStreaming = false; - HRESULT beginStreaming() - { - assert(!isStreaming); - HRESULT hr = mft->ProcessMessage(MFT_MESSAGE_NOTIFY_BEGIN_STREAMING, (ULONG_PTR)0); - isStreaming = SUCCEEDED(hr); - return hr; - } - HRESULT endStreaming() - { - assert(isStreaming); - HRESULT hr = mft->ProcessMessage(MFT_MESSAGE_NOTIFY_END_STREAMING, (ULONG_PTR)0); - isStreaming = SUCCEEDED(hr); - return hr; - } bool streamStarted = false; - HRESULT startStream() - { - assert(!streamStarted); - HRESULT hr = mft->ProcessMessage(MFT_MESSAGE_NOTIFY_START_OF_STREAM, (ULONG_PTR)0); - streamStarted = SUCCEEDED(hr); - return hr; - } - HRESULT endStream() - { - assert(streamStarted); - HRESULT hr = mft->ProcessMessage(MFT_MESSAGE_NOTIFY_END_OF_STREAM, (ULONG_PTR)0); - if (SUCCEEDED(hr)) - streamStarted = false; - return hr; - } - HRESULT flushStream() - { - HRESULT hr = mft->ProcessMessage(MFT_MESSAGE_COMMAND_FLUSH, 0); - if (streamStarted) - { - streamStarted = false; - startStream(); - } - return hr; - } }; struct mf_d3d11_pic_ctx { struct d3d11_pic_context ctx; IMFMediaBuffer *out_media; - decoder_sys_t *mfdec; + mft_dec_sys_t *mfdec; }; #define MF_D3D11_PICCONTEXT_FROM_PICCTX(pic_ctx) \ container_of(pic_ctx, mf_d3d11_pic_ctx, ctx.s) @@ -335,7 +331,7 @@ static int SetInputType(decoder_t *p_dec, DWORD stream_id, ComPtr<IMFMediaType> & result) { - decoder_sys_t *p_sys = static_cast<decoder_sys_t*>(p_dec->p_sys); + mft_dec_sys_t *p_sys = static_cast<mft_dec_sys_t*>(p_dec->p_sys); HRESULT hr; result.Reset(); @@ -466,7 +462,7 @@ static int SetOutputType(decoder_t *p_dec, DWORD stream_id) { - decoder_sys_t *p_sys = static_cast<decoder_sys_t*>(p_dec->p_sys); + mft_dec_sys_t *p_sys = static_cast<mft_dec_sys_t*>(p_dec->p_sys); HRESULT hr; ComPtr<IMFMediaType> output_media_type; @@ -592,7 +588,7 @@ static int AllocateInputSample(decoder_t *p_dec, DWORD stream_id, ComPtr<IMFSample> & result, DWORD size) { - decoder_sys_t *p_sys = static_cast<decoder_sys_t*>(p_dec->p_sys); + mft_dec_sys_t *p_sys = static_cast<mft_dec_sys_t*>(p_dec->p_sys); HRESULT hr; result.Reset(); @@ -630,7 +626,7 @@ static int AllocateOutputSample(decoder_t *p_dec, DWORD stream_id, ComPtr<IMFSample> & result) { - decoder_sys_t *p_sys = static_cast<decoder_sys_t*>(p_dec->p_sys); + mft_dec_sys_t *p_sys = static_cast<mft_dec_sys_t*>(p_dec->p_sys); HRESULT hr; result.Reset(); @@ -690,7 +686,7 @@ static int ProcessInputStream(decoder_t *p_dec, DWORD stream_id, block_t *p_block) { - decoder_sys_t *p_sys = static_cast<decoder_sys_t*>(p_dec->p_sys); + mft_dec_sys_t *p_sys = static_cast<mft_dec_sys_t*>(p_dec->p_sys); HRESULT hr = S_OK; ComPtr<IMFSample> input_sample; @@ -794,7 +790,7 @@ static void d3d11mf_pic_context_destroy(picture_context_t *ctx) { mf_d3d11_pic_ctx *pic_ctx = MF_D3D11_PICCONTEXT_FROM_PICCTX(ctx);
View file
_service:obs_scm:vlc-beta-20220206.71a389dfe1.obscpio/modules/codec/png.c -> _service:obs_scm:vlc-beta-20220209.5820200442.obscpio/modules/codec/png.c
Changed
@@ -30,6 +30,7 @@ #include <vlc_common.h> #include <vlc_plugin.h> #include <vlc_codec.h> +#include <vlc_rand.h> #include <png.h> /* PNG_SYS_COMMON_MEMBERS: @@ -181,6 +182,53 @@ msg_Warn( p_sys->p_obj, "%s", warning_msg ); } +#ifdef PNG_TEXT_SUPPORTED +static void process_text_chunk( decoder_t *p_dec, const png_textp chunk ) +{ + if( chunk->compression != PNG_ITXT_COMPRESSION_NONE || + memcmp( chunk->key, "XML:com.adobe.xmp", 17 ) || + chunk->itxt_length < 20 ) + return; + + const char *exifxmp = (const char *) chunk->text; + const char *orient = strnstr( exifxmp, ":Orientation>", chunk->itxt_length ); + if(orient && orient - exifxmp > 14) + p_dec->fmt_out.video.orientation = ORIENT_FROM_EXIF( orient[13] - '0' ); +} + +static int make_xmp_packet( const video_format_t *fmt, png_textp chunk ) +{ + unsigned char id[9]; + vlc_rand_bytes(id, 8); + for(int i=0; i<8; i++) + id[i] = (id[i] % 26) + 'A'; + id[8] = '\0'; + int len = asprintf( &chunk->text, + "<?xpacket begin='' id='%s'?>" + "<x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='VLC " VERSION "'>" + "<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>" + "<rdf:Description rdf:about='' xmlns:tiff='http://ns.adobe.com/tiff/1.0/'>" + "<tiff:Orientation>%" PRIu8 "</tiff:Orientation>" + "</rdf:Description>" + "</rdf:RDF>" + "</x:xmpmeta>" + "<?xpacket end='r'?>", id, ORIENT_TO_EXIF(fmt->orientation) ); + if(len == 0) + { + free(chunk->text); + chunk->text = NULL; + } + chunk->itxt_length = (len <= 0) ? 0 : len; + chunk->compression = PNG_ITXT_COMPRESSION_NONE; + chunk->key = len > 0 ? strdup( "XML:com.adobe.xmp" ) : NULL; + chunk->lang_key = NULL; + chunk->lang = NULL; + chunk->text_length = 0; + return len > 0 ? VLC_SUCCESS : VLC_EGENERIC; +} + +#endif + /**************************************************************************** * DecodeBlock: the whole thing **************************************************************************** @@ -255,6 +303,14 @@ p_dec->fmt_out.video.i_sar_num = 1; p_dec->fmt_out.video.i_sar_den = 1; +#ifdef PNG_TEXT_SUPPORTED + png_textp textp; + int numtextp; + if( png_get_text( p_png, p_info, &textp, &numtextp ) > 0 ) + for( int ii=0; ii<numtextp; ii++ ) + process_text_chunk( p_dec, &textp[ii] ); +#endif + if( i_color_type == PNG_COLOR_TYPE_PALETTE ) png_set_palette_to_rgb( p_png ); @@ -403,7 +459,19 @@ PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT ); if( p_sys->b_error ) goto error; - png_write_info( p_png, p_info ); +#ifdef PNG_TEXT_SUPPORTED + png_text text; + if( make_xmp_packet( &p_pic->format, &text ) == VLC_SUCCESS ) + { + png_set_text( p_png, p_info, &text, 1 ); + png_write_info( p_png, p_info ); + free( text.key ); + free( text.text ); + } + else +#endif + png_write_info( p_png, p_info ); + if( p_sys->b_error ) goto error; /* Encode picture */
View file
_service:obs_scm:vlc-beta-20220206.71a389dfe1.obscpio/modules/gui/macosx/panels/VLCVideoEffectsWindowController.m -> _service:obs_scm:vlc-beta-20220209.5820200442.obscpio/modules/gui/macosx/panels/VLCVideoEffectsWindowController.m
Changed
@@ -182,7 +182,7 @@ [VLCVideoFilterHelper setVideoFilterProperty: "wall-cols" forFilter: "wall" withValue: getWidgetIntValue([items objectAtIndex:31])]; if ([items count] >= 33) { // version >=2 of profile string - [VLCVideoFilterHelper setVideoFilterProperty: "brightness-threshold" forFilter: "adjust" withValue: (vlc_value_t){ .b_bool = [[items objectAtIndex:32] intValue] }]; + /* "brightness-threshold" at 32 */ } vlc_value_t hueValue; @@ -571,7 +571,6 @@ [self setWidgetValue: _adjustContrastSlider forOption: "contrast" enabled: b_state]; [self setWidgetValue: _adjustBrightnessSlider forOption: "brightness" enabled: b_state]; [self setWidgetValue: _adjustSaturationSlider forOption: "saturation" enabled: b_state]; - [self setWidgetValue: _adjustBrightnessCheckbox forOption: "brightness-threshold" enabled: b_state]; [self setWidgetValue: _adjustGammaSlider forOption: "gamma" enabled: b_state]; [_adjustBrightnessLabel setEnabled: b_state]; [_adjustContrastLabel setEnabled: b_state]; @@ -704,7 +703,7 @@ var_InheritInteger(vout, "wall-rows"), var_InheritInteger(vout, "wall-cols"), // version 2 of profile string: - (int64_t)var_InheritBool(vout, "brightness-threshold"), // index: 32 + 0LL /* "brightness-threshold" */, // index: 32 // version 3 of profile string: (vlc-3.0.0) var_InheritFloat(vout, "hue") // index: 33 ]; @@ -927,7 +926,7 @@ [VLCVideoFilterHelper setVideoFilter: "adjust" on: b_state]; [_adjustBrightnessSlider setEnabled: b_state]; - [_adjustBrightnessCheckbox setEnabled: b_state]; + [_adjustBrightnessCheckbox setEnabled: NO]; [_adjustBrightnessLabel setEnabled: b_state]; [_adjustContrastSlider setEnabled: b_state]; [_adjustContrastLabel setEnabled: b_state]; @@ -964,13 +963,6 @@ [sender setToolTip: [NSString stringWithFormat:@"%0.3f", [sender floatValue]]]; } -- (IBAction)enableAdjustBrightnessThreshold:(id)sender -{ - [VLCVideoFilterHelper setVideoFilterProperty: "brightness-threshold" - forFilter: "adjust" - withValue: getWidgetBoolValue(sender)]; -} - - (IBAction)enableSharpen:(id)sender { BOOL b_state = [_sharpenCheckbox state];
View file
_service:obs_scm:vlc-beta-20220206.71a389dfe1.obscpio/modules/gui/qt/player/qml/SliderBar.qml -> _service:obs_scm:vlc-beta-20220209.5820200442.obscpio/modules/gui/qt/player/qml/SliderBar.qml
Changed
@@ -148,8 +148,19 @@ states: [ State { + name: "hidden" + when: !control.visible + PropertyChanges { + target: bufferRect + width: bufferAnimWidth + visible: false + x: 0 + animateLoading: false + } + }, + State { name: "buffering not started" - when: Player.buffering === 0 + when: control.visible && Player.buffering === 0 PropertyChanges { target: bufferRect width: bufferAnimWidth @@ -160,7 +171,7 @@ }, State { name: "time to start playing known" - when: Player.buffering < 1 + when: control.visible && Player.buffering < 1 PropertyChanges { target: bufferRect width: Player.buffering * parent.width @@ -171,7 +182,7 @@ }, State { name: "playing from buffer" - when: Player.buffering === 1 + when: control.visible && Player.buffering === 1 PropertyChanges { target: bufferRect width: Player.buffering * parent.width
View file
_service:obs_scm:vlc-beta-20220206.71a389dfe1.obscpio/modules/hw/d3d11/d3d11_filters.c -> _service:obs_scm:vlc-beta-20220209.5820200442.obscpio/modules/hw/d3d11/d3d11_filters.c
Changed
@@ -63,7 +63,6 @@ typedef struct { float f_gamma; - bool b_brightness_threshold; struct filter_level Brightness; struct filter_level Contrast; @@ -81,10 +80,6 @@ ID3D11VideoProcessorOutputView *procOutput[PROCESSOR_SLICES]; } filter_sys_t; -#define THRES_TEXT N_("Brightness threshold") -#define THRES_LONGTEXT N_("When this mode is enabled, pixels will be " \ - "shown as black or white. The threshold value will be the brightness " \ - "defined below." ) #define CONT_TEXT N_("Image contrast (0-2)") #define CONT_LONGTEXT N_("Set the image contrast, between 0 and 2. Defaults to 1.") #define HUE_TEXT N_("Image hue (0-360)") @@ -97,8 +92,7 @@ #define GAMMA_LONGTEXT N_("Set the image gamma, between 0.01 and 10. Defaults to 1.") static const char *const ppsz_filter_options[] = { - "contrast", "brightness", "hue", "saturation", "gamma", - "brightness-threshold", NULL + "contrast", "brightness", "hue", "saturation", "gamma", NULL }; static bool ApplyFilter( filter_sys_t *p_sys, @@ -344,8 +338,6 @@ var_DelCallback( filter, "hue", AdjustCallback, sys ); var_DelCallback( filter, "saturation", AdjustCallback, sys ); var_DelCallback( filter, "gamma", AdjustCallback, sys ); - var_DelCallback( filter, "brightness-threshold", - AdjustCallback, sys ); for (int i=0; i<PROCESSOR_SLICES; i++) { @@ -455,16 +447,12 @@ InitLevel(filter, &sys->Hue, "hue", 0.0 ); InitLevel(filter, &sys->Saturation, "saturation", 1.0 ); sys->f_gamma = var_CreateGetFloatCommand( filter, "gamma" ); - sys->b_brightness_threshold = - var_CreateGetBoolCommand( filter, "brightness-threshold" ); var_AddCallback( filter, "contrast", AdjustCallback, sys ); var_AddCallback( filter, "brightness", AdjustCallback, sys ); var_AddCallback( filter, "hue", AdjustCallback, sys ); var_AddCallback( filter, "saturation", AdjustCallback, sys ); var_AddCallback( filter, "gamma", AdjustCallback, sys ); - var_AddCallback( filter, "brightness-threshold", - AdjustCallback, sys ); hr = ID3D11VideoDevice_CreateVideoProcessor(sys->d3d_proc.d3dviddev, sys->d3d_proc.procEnumerator, 0, @@ -584,9 +572,6 @@ add_float_with_range( "gamma", 1.0, 0.01, 10.0, GAMMA_TEXT, GAMMA_LONGTEXT ) change_safe() - add_bool( "brightness-threshold", false, - THRES_TEXT, THRES_LONGTEXT ) - change_safe() add_submodule() set_description(N_("Direct3D11 deinterlace filter"))
View file
_service:obs_scm:vlc-beta-20220206.71a389dfe1.obscpio/modules/hw/d3d9/d3d9_filters.c -> _service:obs_scm:vlc-beta-20220209.5820200442.obscpio/modules/hw/d3d9/d3d9_filters.c
Changed
@@ -63,10 +63,6 @@ struct filter_level Saturation; } filter_sys_t; -#define THRES_TEXT N_("Brightness threshold") -#define THRES_LONGTEXT N_("When this mode is enabled, pixels will be " \ - "shown as black or white. The threshold value will be the brightness " \ - "defined below." ) #define CONT_TEXT N_("Image contrast (0-2)") #define CONT_LONGTEXT N_("Set the image contrast, between 0 and 2. Defaults to 1.") #define HUE_TEXT N_("Image hue (0-360)") @@ -79,8 +75,7 @@ #define GAMMA_LONGTEXT N_("Set the image gamma, between 0.01 and 10. Defaults to 1.") static const char *const ppsz_filter_options[] = { - "contrast", "brightness", "hue", "saturation", "gamma", - "brightness-threshold", NULL + "contrast", "brightness", "hue", "saturation", "gamma", NULL }; static void FillSample( DXVA2_VideoSample *p_sample, @@ -431,8 +426,6 @@ var_AddCallback( filter, "hue", AdjustCallback, sys ); var_AddCallback( filter, "saturation", AdjustCallback, sys ); var_AddCallback( filter, "gamma", AdjustCallback, sys ); - var_AddCallback( filter, "brightness-threshold", - AdjustCallback, sys ); hr = IDirectXVideoProcessorService_CreateVideoProcessor( processor, processorGUID, @@ -506,9 +499,6 @@ add_float_with_range( "gamma", 1.0, 0.01, 10.0, GAMMA_TEXT, GAMMA_LONGTEXT ) change_safe() - add_bool( "brightness-threshold", false, - THRES_TEXT, THRES_LONGTEXT ) - change_safe() add_submodule() set_description(N_("Direct3D9 deinterlace filter"))
View file
_service:obs_scm:vlc-beta-20220206.71a389dfe1.obscpio/modules/video_chroma/orient.c -> _service:obs_scm:vlc-beta-20220209.5820200442.obscpio/modules/video_chroma/orient.c
Changed
@@ -34,189 +34,147 @@ #include <vlc_mouse.h> #include <vlc_picture.h> -static void HFlip(int *sx, int *sy, int w, int h, int dx, int dy) +static void vflip(void *restrict dst, ptrdiff_t dst_stride, + const void *restrict src, ptrdiff_t src_stride, + int width, int height, int order) { - VLC_UNUSED( h ); - *sx = w - 1 - dx; - *sy = dy; -} -static void VFlip(int *sx, int *sy, int w, int h, int dx, int dy) -{ - VLC_UNUSED( w ); - *sx = dx; - *sy = h - 1 - dy; -} -static void Transpose(int *sx, int *sy, int w, int h, int dx, int dy) -{ - VLC_UNUSED( h ); VLC_UNUSED( w ); - *sx = dy; - *sy = dx; -} -static void AntiTranspose(int *sx, int *sy, int w, int h, int dx, int dy) -{ - *sx = h - 1 - dy; - *sy = w - 1 - dx; -} -static void R90(int *sx, int *sy, int w, int h, int dx, int dy) -{ - VLC_UNUSED( h ); - *sx = dy; - *sy = w - 1 - dx; -} -static void R180(int *sx, int *sy, int w, int h, int dx, int dy) -{ - *sx = w - 1 - dx; - *sy = h - 1 - dy; -} -static void R270(int *sx, int *sy, int w, int h, int dx, int dy) -{ - VLC_UNUSED( w ); - *sx = h - 1 - dy; - *sy = dx; -} -typedef void (*convert_t)(int *, int *, int, int, int, int); + const unsigned char *src_pixels = src; + unsigned char *restrict dst_pixels = dst; + size_t visible_pitch = width << order; -#define PLANE(f,bits) \ -static void Plane##bits##_##f(plane_t *restrict dst, const plane_t *restrict src) \ -{ \ - const uint##bits##_t *src_pixels = (const void *)src->p_pixels; \ - uint##bits##_t *restrict dst_pixels = (void *)dst->p_pixels; \ - const unsigned src_width = src->i_pitch / sizeof (*src_pixels); \ - const unsigned dst_width = dst->i_pitch / sizeof (*dst_pixels); \ - const unsigned dst_visible_width = dst->i_visible_pitch / sizeof (*dst_pixels); \ - \ - for (int y = 0; y < dst->i_visible_lines; y++) { \ - for (unsigned x = 0; x < dst_visible_width; x++) { \ - int sx, sy; \ - (f)(&sx, &sy, dst_visible_width, dst->i_visible_lines, x, y); \ - dst_pixels[y * dst_width + x] = \ - src_pixels[sy * src_width + sx]; \ - } \ - } \ -} + dst_pixels += dst_stride * height; -static void Plane_VFlip(plane_t *restrict dst, const plane_t *restrict src) -{ - const uint8_t *src_pixels = src->p_pixels; - uint8_t *restrict dst_pixels = dst->p_pixels; - - dst_pixels += dst->i_pitch * dst->i_visible_lines; - for (int y = 0; y < dst->i_visible_lines; y++) { - dst_pixels -= dst->i_pitch; - memcpy(dst_pixels, src_pixels, dst->i_visible_pitch); - src_pixels += src->i_pitch; + for (int y = 0; y < height; y++) { + dst_pixels -= dst_stride; + memcpy(dst_pixels, src_pixels, visible_pitch); + src_pixels += src_stride; } } -#define I422(f) \ -static void Plane422_##f(plane_t *restrict dst, const plane_t *restrict src) \ +#define TRANSFORMS(bits) \ +static void hflip_##bits(void *restrict dst, ptrdiff_t dst_stride, \ + const void *restrict src, ptrdiff_t src_stride, \ + int width, int height) \ { \ - for (int y = 0; y < dst->i_visible_lines; y += 2) { \ - for (int x = 0; x < dst->i_visible_pitch; x++) { \ - int sx, sy, uv; \ - (f)(&sx, &sy, dst->i_visible_pitch, dst->i_visible_lines / 2, \ - x, y / 2); \ - uv = (1 + src->p_pixels[2 * sy * src->i_pitch + sx] + \ - src->p_pixels[(2 * sy + 1) * src->i_pitch + sx]) / 2; \ - dst->p_pixels[y * dst->i_pitch + x] = uv; \ - dst->p_pixels[(y + 1) * dst->i_pitch + x] = uv; \ - } \ + const uint##bits##_t *restrict src_pixels = src; \ + uint##bits##_t *restrict dst_pixels = dst; \ +\ + dst_stride /= bits / 8; \ + src_stride /= bits / 8; \ + dst_pixels += width - 1; \ +\ + for (int y = 0; y < height; y++) { \ + for (int x = 0; x < width; x++) \ + dst_pixels[-x] = src_pixels[x]; \ +\ + src_pixels += src_stride; \ + dst_pixels += dst_stride; \ } \ -} - -#define YUY2(f) \ -static void PlaneYUY2_##f(plane_t *restrict dst, const plane_t *restrict src) \ +} \ +\ +static void vflip_##bits(void *restrict dst, ptrdiff_t dst_stride, \ + const void *restrict src, ptrdiff_t src_stride, \ + int width, int height) \ +{ \ + vflip(dst, dst_stride, src, src_stride, width, height, ctz(bits / 8)); \ +} \ +\ +static void r180_##bits(void *restrict dst, ptrdiff_t dst_stride, \ + const void *restrict src, ptrdiff_t src_stride, \ + int width, int height) \ +{ \ + const unsigned char *src_pixels = src; \ +\ + src_pixels += (height - 1) * src_stride; \ + src_stride *= -1; \ + hflip_##bits(dst, dst_stride, src_pixels, src_stride, width, height); \ +} \ +\ +static void transpose_##bits(void *restrict dst, ptrdiff_t dst_stride, \ + const void *restrict src, ptrdiff_t src_stride, \ + int src_width, int src_height) \ { \ - unsigned dst_visible_width = dst->i_visible_pitch / 2; \ - \ - for (int y = 0; y < dst->i_visible_lines; y += 2) { \ - for (unsigned x = 0; x < dst_visible_width; x+= 2) { \ - int sx0, sy0, sx1, sy1; \ - (f)(&sx0, &sy0, dst_visible_width, dst->i_visible_lines, x, y); \ - (f)(&sx1, &sy1, dst_visible_width, dst->i_visible_lines, \ - x + 1, y + 1); \ - dst->p_pixels[(y + 0) * dst->i_pitch + 2 * (x + 0)] = \ - src->p_pixels[sy0 * src->i_pitch + 2 * sx0]; \ - dst->p_pixels[(y + 0) * dst->i_pitch + 2 * (x + 1)] = \ - src->p_pixels[sy1 * src->i_pitch + 2 * sx0]; \ - dst->p_pixels[(y + 1) * dst->i_pitch + 2 * (x + 0)] = \ - src->p_pixels[sy0 * src->i_pitch + 2 * sx1]; \ - dst->p_pixels[(y + 1) * dst->i_pitch + 2 * (x + 1)] = \ - src->p_pixels[sy1 * src->i_pitch + 2 * sx1]; \ - \ - int sx, sy, u, v; \ - (f)(&sx, &sy, dst_visible_width / 2, dst->i_visible_lines / 2, \ - x / 2, y / 2); \ - u = (1 + src->p_pixels[2 * sy * src->i_pitch + 4 * sx + 1] + \ - src->p_pixels[(2 * sy + 1) * src->i_pitch + 4 * sx + 1]) / 2; \ - v = (1 + src->p_pixels[2 * sy * src->i_pitch + 4 * sx + 3] + \ - src->p_pixels[(2 * sy + 1) * src->i_pitch + 4 * sx + 3]) / 2; \ - dst->p_pixels[(y + 0) * dst->i_pitch + 2 * x + 1] = u; \ - dst->p_pixels[(y + 0) * dst->i_pitch + 2 * x + 3] = v; \ - dst->p_pixels[(y + 1) * dst->i_pitch + 2 * x + 1] = u; \ - dst->p_pixels[(y + 1) * dst->i_pitch + 2 * x + 3] = v; \ - } \ + const uint##bits##_t *restrict src_pixels = src; \ + uint##bits##_t *restrict dst_pixels = dst; \ +\ + dst_stride /= bits / 8; \ + src_stride /= bits / 8; \ +\ + for (int y = 0; y < src_height; y++) { \ + for (int x = 0; x < src_width; x++) \ + dst_pixels[x * dst_stride] = src_pixels[x]; \ + src_pixels += src_stride; \ + dst_pixels++; \ } \ +} \ +\ +static void r270_##bits(void *restrict dst, ptrdiff_t dst_stride, \ + const void *restrict src, ptrdiff_t src_stride, \ + int src_width, int src_height) \ +{ \ + unsigned char *dst_pixels = dst; \ +\ + dst_pixels += (src_width - 1) * dst_stride; \ + dst_stride *= -1; \ + transpose_##bits(dst_pixels, dst_stride, src, src_stride, \
View file
_service:obs_scm:vlc-beta-20220206.71a389dfe1.obscpio/modules/video_filter/adjust.c -> _service:obs_scm:vlc-beta-20220209.5820200442.obscpio/modules/video_filter/adjust.c
Changed
@@ -52,10 +52,6 @@ * Module descriptor *****************************************************************************/ -#define THRES_TEXT N_("Brightness threshold") -#define THRES_LONGTEXT N_("When this mode is enabled, pixels will be " \ - "shown as black or white. The threshold value will be the brightness " \ - "defined below." ) #define CONT_TEXT N_("Image contrast (0-2)") #define CONT_LONGTEXT N_("Set the image contrast, between 0 and 2. Defaults to 1.") #define HUE_TEXT N_("Image hue (-180..180)") @@ -87,17 +83,14 @@ add_float_with_range( "gamma", 1.0, 0.01, 10.0, GAMMA_TEXT, GAMMA_LONGTEXT ) change_safe() - add_bool( "brightness-threshold", false, - THRES_TEXT, THRES_LONGTEXT ) - change_safe() + add_obsolete_bool("brightness-threshold") /* since 4.0.0 */ add_shortcut( "adjust" ) set_callback_video_filter( Create ) vlc_module_end () static const char *const ppsz_filter_options[] = { - "contrast", "brightness", "hue", "saturation", "gamma", - "brightness-threshold", NULL + "contrast", "brightness", "hue", "saturation", "gamma", NULL }; /***************************************************************************** @@ -110,7 +103,6 @@ _Atomic float f_hue; _Atomic float f_saturation; _Atomic float f_gamma; - atomic_bool b_brightness_threshold; int (*pf_process_sat_hue)( picture_t *, picture_t *, int, int, int, int, int ); int (*pf_process_sat_hue_clip)( picture_t *, picture_t *, int, int, @@ -206,8 +198,6 @@ var_CreateGetFloatCommand( p_filter, "saturation" ) ); atomic_init( &p_sys->f_gamma, var_CreateGetFloatCommand( p_filter, "gamma" ) ); - atomic_init( &p_sys->b_brightness_threshold, - var_CreateGetBoolCommand( p_filter, "brightness-threshold" ) ); var_AddCallback( p_filter, "contrast", FloatCallback, &p_sys->f_contrast ); var_AddCallback( p_filter, "brightness", FloatCallback, @@ -216,8 +206,6 @@ var_AddCallback( p_filter, "saturation", FloatCallback, &p_sys->f_saturation ); var_AddCallback( p_filter, "gamma", FloatCallback, &p_sys->f_gamma ); - var_AddCallback( p_filter, "brightness-threshold", BoolCallback, - &p_sys->b_brightness_threshold ); return VLC_SUCCESS; } @@ -236,8 +224,6 @@ var_DelCallback( p_filter, "saturation", FloatCallback, &p_sys->f_saturation ); var_DelCallback( p_filter, "gamma", FloatCallback, &p_sys->f_gamma ); - var_DelCallback( p_filter, "brightness-threshold", BoolCallback, - &p_sys->b_brightness_threshold ); } /***************************************************************************** @@ -281,44 +267,20 @@ int i_sat = (int)( atomic_load_explicit( &p_sys->f_saturation, memory_order_relaxed ) * f_range ); float f_gamma = 1.f / atomic_load_explicit( &p_sys->f_gamma, memory_order_relaxed ); - /* - * Threshold mode drops out everything about luma, contrast and gamma. - */ - if( !atomic_load_explicit( &p_sys->b_brightness_threshold, - memory_order_relaxed ) ) - { - - /* Contrast is a fast but kludged function, so I put this gap to be - * cleaner :) */ - i_lum += i_mid - i_cont / 2; - - /* Fill the gamma lookup table */ - for( unsigned i = 0 ; i < i_size; i++ ) - { - pi_gamma[ i ] = VLC_CLIP( powf(i / f_max, f_gamma) * f_max, 0, i_max ); - } + /* Contrast is a fast but kludged function, so I put this gap to be + * cleaner :) */ + i_lum += i_mid - i_cont / 2; - /* Fill the luma lookup table */ - for( unsigned i = 0 ; i < i_size; i++ ) - { - pi_luma[ i ] = pi_gamma[VLC_CLIP( (int)(i_lum + i_cont * i / i_range), 0, (int) i_max )]; - } - } - else + /* Fill the gamma lookup table */ + for( unsigned i = 0 ; i < i_size; i++ ) { - /* - * We get luma as threshold value: the higher it is, the darker is - * the image. Should I reverse this? - */ - for( int i = 0 ; i < i_range; i++ ) - { - pi_luma[ i ] = (i < i_lum) ? 0 : i_max; - } + pi_gamma[ i ] = VLC_CLIP( powf(i / f_max, f_gamma) * f_max, 0, i_max ); + } - /* - * Desaturates image to avoid that strange yellow halo... - */ - i_sat = 0; + /* Fill the luma lookup table */ + for( unsigned i = 0 ; i < i_size; i++ ) + { + pi_luma[ i ] = pi_gamma[VLC_CLIP( (int)(i_lum + i_cont * i / i_range), 0, (int) i_max )]; } /* @@ -477,43 +439,20 @@ i_sat = (int)( atomic_load_explicit( &p_sys->f_saturation, memory_order_relaxed ) * 256 ); f_gamma = 1.0 / atomic_load_explicit( &p_sys->f_gamma, memory_order_relaxed ); - /* - * Threshold mode drops out everything about luma, contrast and gamma. - */ - if( !atomic_load_explicit( &p_sys->b_brightness_threshold, memory_order_relaxed ) ) - { - - /* Contrast is a fast but kludged function, so I put this gap to be - * cleaner :) */ - i_lum += 128 - i_cont / 2; + /* Contrast is a fast but kludged function, so I put this gap to be + * cleaner :) */ + i_lum += 128 - i_cont / 2; - /* Fill the gamma lookup table */ - for( int i = 0 ; i < 256 ; i++ ) - { - pi_gamma[ i ] = clip_uint8_vlc( pow(i / 255.0, f_gamma) * 255.0); - } - - /* Fill the luma lookup table */ - for( int i = 0 ; i < 256 ; i++ ) - { - pi_luma[ i ] = pi_gamma[clip_uint8_vlc( i_lum + i_cont * i / 256)]; - } - } - else + /* Fill the gamma lookup table */ + for( int i = 0 ; i < 256 ; i++ ) { - /* - * We get luma as threshold value: the higher it is, the darker is - * the image. Should I reverse this? - */ - for( int i = 0 ; i < 256 ; i++ ) - { - pi_luma[ i ] = (i < i_lum) ? 0 : 255; - } + pi_gamma[ i ] = clip_uint8_vlc( pow(i / 255.0, f_gamma) * 255.0); + } - /* - * Desaturates image to avoid that strange yellow halo... - */ - i_sat = 0; + /* Fill the luma lookup table */ + for( int i = 0 ; i < 256 ; i++ ) + { + pi_luma[ i ] = pi_gamma[clip_uint8_vlc( i_lum + i_cont * i / 256)]; } /*
View file
_service:obs_scm:vlc-beta-20220206.71a389dfe1.obscpio/modules/video_filter/rotate.c -> _service:obs_scm:vlc-beta-20220209.5820200442.obscpio/modules/video_filter/rotate.c
Changed
@@ -82,40 +82,26 @@ "angle", "use-motion", NULL }; -/***************************************************************************** - * filter_sys_t - *****************************************************************************/ +typedef struct { + int16_t sin; + int16_t cos; +} sincos_t; + typedef struct { - atomic_uint_fast32_t sincos; + _Atomic sincos_t sincos; motion_sensors_t *p_motion; } filter_sys_t; -typedef union { - uint32_t u; - struct { - int16_t sin; - int16_t cos; - }; -} sincos_t; - static void store_trigo( filter_sys_t *sys, float f_angle ) { sincos_t sincos; f_angle *= (float)(M_PI / 180.); /* degrees -> radians */ - sincos.sin = lroundf(sinf(f_angle) * 4096.f); - sincos.cos = lroundf(cosf(f_angle) * 4096.f); - atomic_store(&sys->sincos, sincos.u); -} - -static void fetch_trigo( filter_sys_t *sys, int *i_sin, int *i_cos ) -{ - sincos_t sincos = { .u = atomic_load(&sys->sincos) }; - - *i_sin = sincos.sin; - *i_cos = sincos.cos; + sincos.sin = lroundf(ldexpf(sinf(f_angle), 12)); + sincos.cos = lroundf(ldexpf(cosf(f_angle), 12)); + atomic_store_explicit(&sys->sincos, sincos, memory_order_relaxed); } static const struct vlc_filter_operations packed_filter_ops = @@ -220,17 +206,15 @@ store_trigo( p_sys, i_angle / 20.f ); } - int i_sin, i_cos; - fetch_trigo( p_sys, &i_sin, &i_cos ); - p_mouse->i_x = ( p_fmt->i_visible_width >> 1 ); p_mouse->i_y = ( p_fmt->i_visible_height >> 1 ); const int i_rx = ( i_x - p_mouse->i_x ); const int i_ry = ( i_y - p_mouse->i_y ); + sincos_t sc = atomic_load_explicit(&p_sys->sincos, memory_order_relaxed); - p_mouse->i_x += ( ( i_rx * i_cos - i_ry * i_sin )>> 12 ); - p_mouse->i_y += ( ( i_rx * i_sin + i_ry * i_cos )>> 12 ); + p_mouse->i_x += ( ( i_rx * sc.cos - i_ry * sc.sin )>> 12 ); + p_mouse->i_y += ( ( i_rx * sc.sin + i_ry * sc.cos )>> 12 ); return VLC_SUCCESS; } @@ -248,8 +232,7 @@ store_trigo( p_sys, i_angle / 20.f ); } - int i_sin, i_cos; - fetch_trigo( p_sys, &i_sin, &i_cos ); + sincos_t sc = atomic_load_explicit(&p_sys->sincos, memory_order_relaxed); for( int i_plane = 0 ; i_plane < p_pic->i_planes ; i_plane++ ) { @@ -267,12 +250,12 @@ const uint8_t black_pixel = ( i_plane == Y_PLANE ) ? 0x00 : 0x80; - const int i_line_next = i_cos / i_aspect -i_sin*i_visible_pitch; - const int i_col_next = -i_sin / i_aspect -i_cos*i_visible_pitch; - int i_line_orig0 = ( - i_cos * i_line_center / i_aspect - - i_sin * i_col_center + (1<<11) ); - int i_col_orig0 = i_sin * i_line_center / i_aspect - - i_cos * i_col_center + (1<<11); + const int i_line_next = sc.cos / i_aspect -sc.sin*i_visible_pitch; + const int i_col_next = -sc.sin / i_aspect -sc.cos*i_visible_pitch; + int i_line_orig0 = ( - sc.cos * i_line_center / i_aspect + - sc.sin * i_col_center + (1<<11) ); + int i_col_orig0 = sc.sin * i_line_center / i_aspect + - sc.cos * i_col_center + (1<<11); for( int y = 0; y < i_visible_lines; y++) { uint8_t *p_out = &p_dstp->p_pixels[y * p_dstp->i_pitch]; @@ -341,8 +324,8 @@ *p_out = black_pixel; } - i_line_orig0 += i_sin; - i_col_orig0 += i_cos; + i_line_orig0 += sc.sin; + i_col_orig0 += sc.cos; } i_line_orig0 += i_line_next; @@ -401,8 +384,7 @@ store_trigo( p_sys, i_angle / 20.f ); } - int i_sin, i_cos; - fetch_trigo( p_sys, &i_sin, &i_cos ); + sincos_t sc = atomic_load_explicit(&p_sys->sincos, memory_order_relaxed); for( int i_line = 0; i_line < i_visible_lines; i_line++ ) { @@ -412,11 +394,11 @@ int i_col_orig; /* Handle "1st Y", U and V */ i_line_orig = i_line_center + - ( ( i_sin * ( i_col - i_col_center ) - + i_cos * ( i_line - i_line_center ) )>>12 ); + ( ( sc.sin * ( i_col - i_col_center ) + + sc.cos * ( i_line - i_line_center ) )>>12 ); i_col_orig = i_col_center + - ( ( i_cos * ( i_col - i_col_center ) - - i_sin * ( i_line - i_line_center ) )>>12 ); + ( ( sc.cos * ( i_col - i_col_center ) + - sc.sin * ( i_line - i_line_center ) )>>12 ); if( 0 <= i_col_orig && i_col_orig < i_visible_pitch && 0 <= i_line_orig && i_line_orig < i_visible_lines ) { @@ -438,11 +420,11 @@ break; i_line_orig = i_line_center + - ( ( i_sin * ( i_col - i_col_center ) - + i_cos * ( i_line - i_line_center ) )>>12 ); + ( ( sc.sin * ( i_col - i_col_center ) + + sc.cos * ( i_line - i_line_center ) )>>12 ); i_col_orig = i_col_center + - ( ( i_cos * ( i_col - i_col_center ) - - i_sin * ( i_line - i_line_center ) )>>12 ); + ( ( sc.cos * ( i_col - i_col_center ) + - sc.sin * ( i_line - i_line_center ) )>>12 ); if( 0 <= i_col_orig && i_col_orig < i_visible_pitch && 0 <= i_line_orig && i_line_orig < i_visible_lines ) {
View file
_service:obs_scm:vlc-beta-20220206.71a389dfe1.obscpio/modules/video_output/opengl/filter_mock.c -> _service:obs_scm:vlc-beta-20220209.5820200442.obscpio/modules/video_output/opengl/filter_mock.c
Changed
@@ -619,8 +619,13 @@ set_callback_opengl_filter(Open) add_shortcut("mock"); add_float(MOCK_CFG_PREFIX "angle", 0.f, NULL, NULL) /* in degrees */ + change_volatile() add_float(MOCK_CFG_PREFIX "speed", 0.f, NULL, NULL) /* in rotations per minute */ + change_volatile() add_bool(MOCK_CFG_PREFIX "mask", false, NULL, NULL) + change_volatile() add_bool(MOCK_CFG_PREFIX "plane", false, NULL, NULL) - add_integer(MOCK_CFG_PREFIX "msaa", 4, NULL, NULL); + change_volatile() + add_integer(MOCK_CFG_PREFIX "msaa", 4, NULL, NULL) + change_volatile() vlc_module_end()
View file
_service:obs_scm:vlc-beta.obsinfo
Changed
@@ -1,5 +1,5 @@ name: vlc-beta -version: 20220206.71a389dfe1 -mtime: 1644158970 -commit: 71a389dfe146bb5dc14c192a91296ed9ebd3573f +version: 20220209.5820200442 +mtime: 1644392208 +commit: 58202004426ce9ac2d8e32ede722a3353a5cbad1
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.