[vlc-commits] [Git][videolan/vlc][master] 2 commits: vout_intf: setup video-stereo-mode callback in init
Steve Lhomme (@robUx4)
gitlab at videolan.org
Wed Feb 5 11:44:30 UTC 2025
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
0f5790f4 by Alexandre Janniaux at 2025-02-05T11:30:36+00:00
vout_intf: setup video-stereo-mode callback in init
Dummy video outputs only define variables and don't use the interactive
interface callbacks as they are not running. Because the callback was
set during the initial variable setup, it would lead to assertion inside
the video_output.c code as the stereo mode was changed dynamically from
a dummy video_output object.
- - - - -
00d01763 by Alexandre Janniaux at 2025-02-05T11:30:36+00:00
test: libvlc: add video smoke test
The test catches the assertion fixed by the previous commit when setting
a video stereo mode on a non-running video output, using a non-playing
player instance.
More smoke tests can be added later for the other player's video
methods and in the case the playback has started.
- - - - -
2 changed files:
- src/video_output/vout_intf.c
- test/libvlc/media_player.c
Changes:
=====================================
src/video_output/vout_intf.c
=====================================
@@ -241,8 +241,6 @@ void vout_CreateVars( vout_thread_t *p_vout )
vlc_gettext( p_3D_output_format_values[i].psz_label ) );
}
- var_AddCallback( p_vout, "video-stereo-mode", Stereo3DCallback, NULL );
-
/* Crop offset vars */
var_Create( p_vout, "crop-left", VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND );
var_Create( p_vout, "crop-top", VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND );
@@ -389,6 +387,7 @@ void vout_IntfInit( vout_thread_t *p_vout )
var_AddCallback( p_vout, "viewpoint", ViewpointCallback, NULL );
var_AddCallback( p_vout, "override-projection", OverrideProjectionCallback, NULL );
var_AddCallback( p_vout, "projection-mode", ChangeProjectionCallback, NULL );
+ var_AddCallback(p_vout, "video-stereo-mode", Stereo3DCallback, NULL);
}
void vout_IntfReinit( vout_thread_t *p_vout )
@@ -405,6 +404,7 @@ void vout_IntfReinit( vout_thread_t *p_vout )
var_TriggerCallback( p_vout, "secondary-sub-margin" );
var_TriggerCallback( p_vout, "projection-mode" );
+ var_TriggerCallback(p_vout, "video-stereo-mode");
}
void vout_IntfDeinit(vlc_object_t *obj)
@@ -430,6 +430,7 @@ void vout_IntfDeinit(vlc_object_t *obj)
var_DelCallback(obj, "autoscale", AutoScaleCallback, NULL);
var_DelCallback(obj, "override-projection", OverrideProjectionCallback, NULL);
var_DelCallback(obj, "projection-mode", ChangeProjectionCallback, NULL);
+ var_DelCallback(obj, "video-stereo-mode", Stereo3DCallback, NULL);
}
/*****************************************************************************
=====================================
test/libvlc/media_player.c
=====================================
@@ -659,6 +659,23 @@ static void test_media_player_multiple_instance(const char** argv, int argc)
libvlc_media_player_release(player2);
}
+static void test_media_player_video_controls(const char** argv, int argc)
+{
+ libvlc_instance_t *instance = libvlc_new(argc, argv);
+
+ /* ...with the media and the player being on different instances */
+ libvlc_media_t *media1 = libvlc_media_new_path("foo");
+ libvlc_media_player_t *player1 = libvlc_media_player_new(instance);
+ libvlc_media_player_set_media(player1, media1);
+
+ libvlc_video_set_video_stereo_mode(player1, libvlc_VideoStereoSideBySide);
+
+ libvlc_media_release(media1);
+ libvlc_media_player_release(player1);
+ libvlc_release(instance);
+}
+
+
int main (void)
{
test_init();
@@ -669,6 +686,7 @@ int main (void)
test_media_player_tracks (test_defaults_args, test_defaults_nargs);
test_media_player_programs (test_defaults_args, test_defaults_nargs);
test_media_player_multiple_instance (test_defaults_args, test_defaults_nargs);
+ test_media_player_video_controls(test_defaults_args, test_defaults_nargs);
return 0;
}
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/aef81693d2a9f48b1d1d2015ceb0959102ef4f09...00d0176322753bdecabcdf991e9771e1b563a916
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/aef81693d2a9f48b1d1d2015ceb0959102ef4f09...00d0176322753bdecabcdf991e9771e1b563a916
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list