[vlc-commits] [Git][videolan/vlc][master] 4 commits: player: fix doc indent
Steve Lhomme (@robUx4)
gitlab at videolan.org
Sat Jul 4 11:55:10 UTC 2026
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
641eab34 by Thomas Guillem at 2026-07-04T11:32:22+00:00
player: fix doc indent
No documentation changes.
- - - - -
ea400035 by Thomas Guillem at 2026-07-04T11:32:22+00:00
player: clarify when next/prev frame is displayed
- - - - -
cc90263f by Thomas Guillem at 2026-07-04T11:32:22+00:00
lib: media_player: add next-frame status
- - - - -
c15d0d85 by Thomas Guillem at 2026-07-04T11:32:22+00:00
lib: media_player: add previous_frame
- - - - -
4 changed files:
- include/vlc/libvlc_media_player.h
- include/vlc_player.h
- lib/libvlc.sym
- lib/media_player.c
Changes:
=====================================
include/vlc/libvlc_media_player.h
=====================================
@@ -522,6 +522,47 @@ struct libvlc_media_player_cbs
void (*on_media_attachments_added)( void *opaque, libvlc_media_t *media,
libvlc_picture_list_t *list );
+ /**
+ * Callback prototype that notify when the next frame, following a call to
+ * `libvlc_media_player_next_frame()`, is about to displayed.
+ *
+ * \note Optional (can be NULL),
+ * available since version 0
+ *
+ * \see libvlc_media_player_next_frame()
+ *
+ * \note This callback is sent just before the frame is sent to the video
+ * output, use libvlc_media_player_watch_time() if you need to know exactly
+ * when the frame is displayed.
+ *
+ * \param opaque opaque pointer set by libvlc_media_player_new()
+ * \param status 0 in case of success, -EAGAIN on first call (paused),
+ * -EBUSY in case of video error, -ENOTSUP if can't pause,
+ * -EINVAL in case of invalid state
+ */
+ void (*on_next_frame_status)( void *opaque, int status );
+
+ /**
+ * Callback prototype that notify when the previous frame, following a call
+ * to `libvlc_media_player_previous_frame()`, is about to be displayed.
+ *
+ * \note Optional (can be NULL),
+ * available since version 0
+ *
+ * \see libvlc_media_player_previous_frame()
+ *
+ * \note This callback is sent just before the frame is sent to the video
+ * output, use libvlc_media_player_watch_time() if you need to know exactly
+ * when the frame is displayed.
+ *
+ * \param opaque opaque pointer set by libvlc_media_player_new()
+ * \param status 0 in case of success, -EAGAIN on first call (paused),
+ * -EBUSY in case of video error, -ENOTSUP if can't pause,
+ * -EINVAL in case of invalid state, -ERANGE if the player could not seek
+ * back
+ */
+ void (*on_prev_frame_status)( void *opaque, int status );
+
/**
* Callback prototype that notify when a new player vout is added or removed
*
@@ -1996,12 +2037,35 @@ LIBVLC_API bool libvlc_media_player_can_pause(libvlc_media_player_t *p_mi);
LIBVLC_API bool libvlc_media_player_program_scrambled( libvlc_media_player_t *p_mi );
/**
- * Display the next frame (if supported)
+ * Pause and display the next video frame.
+ *
+ * \note The player must be playing or paused. If playing, the player will be
+ * paused first.
+ *
+ * \note The user should listen to the
+ * libvlc_media_player_cbs.on_next_frame_status callback, to be notified when
+ * the next frame is displayed.
*
* \param p_mi the media player
+ * \version LibVLC 1.1.1 or later
*/
LIBVLC_API void libvlc_media_player_next_frame( libvlc_media_player_t *p_mi );
+/**
+ * Pause and display the previous video frame.
+ *
+ * \note Works only on streams that support pause, seek, and pace control. If
+ * playing, the player will be paused first.
+ *
+ * \note The user should listen to the
+ * libvlc_media_player_cbs.on_prev_frame_status callback, to be notified when
+ * the previous frame is displayed.
+ *
+ * \param p_mi the media player
+ * \version LibVLC 4.0.0 or later
+ */
+LIBVLC_API void libvlc_media_player_previous_frame( libvlc_media_player_t *p_mi );
+
/**
* Navigate through DVD Menu
*
=====================================
include/vlc_player.h
=====================================
@@ -3338,10 +3338,14 @@ struct vlc_player_cbs
/**
* Called when the next frame, following a call to
- * `vlc_player_NextVideoFrame()`, is displayed.
+ * `vlc_player_NextVideoFrame()`, is about to be displayed.
*
* @see vlc_player_NextVideoFrame()
*
+ * @note This event is sent just before the frame is sent to the video
+ * output, use vlc_player_AddTimer() if you need to know exactly when the
+ * frame is displayed.
+ *
* @param player locked player instance
* @param status 0 in case of success, -EAGAIN on first call (paused),
* -EBUSY in case of video error, -ENOTSUP if can't pause,
@@ -3350,19 +3354,23 @@ struct vlc_player_cbs
void (*on_next_frame_status)(vlc_player_t *player, int status, void *data);
/**
- * Called when the previous frame, following a call to
- * `vlc_player_PreviousVideoFrame()`, is displayed.
- *
- * @see vlc_player_PreviousVideoFrame()
- *
- * @param player locked player instance
- * @param status 0 in case of success,
- * -EAGAIN on first call (paused) or on first frame,
- * -EBUSY in case of video error,
- * -ENOTSUP if can't pause/seek/pace,
- * -EINVAL in case of invalid state,
- * -ERANGE if the player could not seek back
- */
+ * Called when the previous frame, following a call to
+ * `vlc_player_PreviousVideoFrame()`, is about to displayed.
+ *
+ * @see vlc_player_PreviousVideoFrame()
+ *
+ * @note This event is sent just before the frame is sent to the video
+ * output, use vlc_player_AddTimer() if you need to know exactly when the
+ * frame is displayed.
+ *
+ * @param player locked player instance
+ * @param status 0 in case of success,
+ * -EAGAIN on first call (paused) or on first frame,
+ * -EBUSY in case of video error,
+ * -ENOTSUP if can't pause/seek/pace,
+ * -EINVAL in case of invalid state,
+ * -ERANGE if the player could not seek back
+ */
void (*on_prev_frame_status)(vlc_player_t *player, int status, void *data);
};
=====================================
lib/libvlc.sym
=====================================
@@ -123,6 +123,7 @@ libvlc_media_player_add_slave
libvlc_media_player_can_pause
libvlc_media_player_program_scrambled
libvlc_media_player_next_frame
+libvlc_media_player_previous_frame
libvlc_media_player_get_chapter
libvlc_media_player_get_chapter_count
libvlc_media_player_get_chapter_count_for_title
=====================================
lib/media_player.c
=====================================
@@ -511,6 +511,32 @@ on_vout_changed(vlc_player_t *player, enum vlc_player_vout_action action,
mp->cbs->on_vout_changed(mp->cbs_opaque, count);
}
+static void
+on_next_frame_status(vlc_player_t *player, int status, void *data)
+{
+ (void) player;
+
+ libvlc_media_player_t *mp = data;
+
+ if (mp->cbs == NULL || mp->cbs->on_next_frame_status == NULL)
+ return;
+
+ mp->cbs->on_next_frame_status(mp->cbs_opaque, status);
+}
+
+static void
+on_prev_frame_status(vlc_player_t *player, int status, void *data)
+{
+ (void) player;
+
+ libvlc_media_player_t *mp = data;
+
+ if (mp->cbs == NULL || mp->cbs->on_prev_frame_status == NULL)
+ return;
+
+ mp->cbs->on_prev_frame_status(mp->cbs_opaque, status);
+}
+
// player aout callbacks
static void
@@ -574,6 +600,8 @@ static const struct vlc_player_cbs vlc_player_cbs = {
.on_vout_changed = on_vout_changed,
.on_recording_changed = on_recording_changed,
.on_stopping_current_media = on_stopping_current_media,
+ .on_next_frame_status = on_next_frame_status,
+ .on_prev_frame_status = on_prev_frame_status,
};
static const struct vlc_player_aout_cbs vlc_player_aout_cbs = {
@@ -1955,6 +1983,16 @@ void libvlc_media_player_next_frame( libvlc_media_player_t *p_mi )
vlc_player_Unlock(player);
}
+void libvlc_media_player_previous_frame( libvlc_media_player_t *p_mi )
+{
+ vlc_player_t *player = p_mi->player;
+ vlc_player_Lock(player);
+
+ vlc_player_PreviousVideoFrame(player);
+
+ vlc_player_Unlock(player);
+}
+
/**
* Private lookup table to get subpicture alignment flag values corresponding
* to a libvlc_position_t enumerated value.
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/833937264a466e083eef06286457403823e6312f...c15d0d852d0045f1a9bf187f5a863a79f686144f
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/833937264a466e083eef06286457403823e6312f...c15d0d852d0045f1a9bf187f5a863a79f686144f
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help
More information about the vlc-commits
mailing list