[vlc-commits] [Git][videolan/vlc][master] 2 commits: input: move input_source_t to its own files

2024-04-15 Thread Steve Lhomme (@robUx4)


Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
b0b5f693 by Alexandre Janniaux at 2024-04-15T06:34:38+00:00
input: move input_source_t to its own files

input_source_t doesnt depend on anything, so it can be moved to its own
files so that it can be included in tests without using input.c also.

- - - - -
c1b91b1e by Alexandre Janniaux at 2024-04-15T06:34:38+00:00
input: move item parse to its own file

Input item parsing depends on other components and exposes its own new
objects so separate it from the main input.c file to ease compilation
with tests.

- - - - -


9 changed files:

- src/Makefile.am
- src/input/es_out.c
- src/input/input.c
- src/input/input_internal.h
- src/input/item.c
- + src/input/parse.c
- + src/input/source.c
- + src/input/source.h
- src/meson.build


Changes:

=
src/Makefile.am
=
@@ -288,6 +288,7 @@ libvlccore_la_SOURCES = \
input/info.h \
input/meta.c \
input/attachment.c \
+   input/parse.c \
player/player.c \
player/player.h \
player/input.c \
@@ -316,6 +317,8 @@ libvlccore_la_SOURCES = \
input/resource.h \
input/resource.c \
input/services_discovery.c \
+   input/source.c \
+   input/source.h \
input/stats.c \
input/stream.c \
input/stream_fifo.c \


=
src/input/es_out.c
=
@@ -46,6 +46,7 @@
 #include 
 
 #include "input_internal.h"
+#include "./source.h"
 #include "../clock/input_clock.h"
 #include "../clock/clock.h"
 #include "decoder.h"


=
src/input/input.c
=
@@ -2790,36 +2790,6 @@ static int InputSourceInit( input_source_t *in, 
input_thread_t *p_input,
 return VLC_SUCCESS;
 }
 
-input_source_t *input_source_Hold( input_source_t *in )
-{
-vlc_atomic_rc_inc( >rc );
-return in;
-}
-
-void input_source_Release( input_source_t *in )
-{
-if( vlc_atomic_rc_dec( >rc ) )
-{
-free( in->str_id );
-free( in );
-}
-}
-
-const char *input_source_GetStrId( input_source_t *in )
-{
-return in->str_id;
-}
-
-int input_source_GetNewAutoId( input_source_t *in )
-{
-return in->auto_id++;
-}
-
-bool input_source_IsAutoSelected( input_source_t *in )
-{
-return in->autoselected;
-}
-
 /*
  * InputSourceDestroy:
  */


=
src/input/input_internal.h
=
@@ -27,6 +27,7 @@
 #include 
 #include "input_interface.h"
 #include "../misc/interrupt.h"
+#include "./source.h"
 
 struct input_stats;
 
@@ -373,53 +374,6 @@ input_item_t* input_GetItem( input_thread_t * ) VLC_USED;
 
 #define INPUT_CONTROL_FIFO_SIZE100
 
-/* input_source_t: gathers all information per input source */
-struct input_source_t
-{
-vlc_atomic_rc_t rc;
-
-demux_t  *p_demux; /**< Demux object (most downstream) */
-es_out_t *p_slave_es_out; /**< Slave es out */
-
-char *str_id;
-int auto_id;
-bool autoselected;
-
-/* Title infos for that input */
-bool b_title_demux; /* Titles/Seekpoints provided by demux */
-int  i_title;
-input_title_t **title;
-
-int i_title_offset;
-int i_seekpoint_offset;
-
-int i_title_start;
-int i_title_end;
-int i_seekpoint_start;
-int i_seekpoint_end;
-
-/* Properties */
-bool b_can_pause;
-bool b_can_pace_control;
-bool b_can_rate_control;
-bool b_can_stream_record;
-bool b_rescale_ts;
-double f_fps;
-
-/* sub-fps handling */
-bool b_slave_sub;
-float sub_rate;
-
-/* */
-vlc_tick_t i_pts_delay;
-
-/* Read-write protected by es_out.c lock */
-vlc_tick_t i_normal_time;
-
-bool   b_eof;   /* eof of demuxer */
-
-};
-
 typedef union
 {
 vlc_value_t val;
@@ -683,37 +637,6 @@ input_attachment_t *input_GetAttachment(input_thread_t 
*input, const char *name)
 
 bool input_CanPaceControl(input_thread_t *input);
 
-/**
- * Hold the input_source_t
- */
-input_source_t *input_source_Hold( input_source_t *in );
-
-/**
- * Release the input_source_t
- */
-void input_source_Release( input_source_t *in );
-
-/**
- * Returns the string identifying this input source
- *
- * @return a string id or NULL if the source is the master
- */
-const char *input_source_GetStrId( input_source_t *in );
-
-/**
- * Get a new fmt.i_id from the input source
- *
- * This auto id will be relative to this input source. It allows to have stable
- * ids across different playback instances, by not relying on the input source
- * addition order.
- */
-int input_source_GetNewAutoId( input_source_t *in );
-
-/**
- * Returns true if a given source should be auto-selected
- */
-bool 

[vlc-commits] [Git][videolan/vlc][master] 4 commits: display: keep the video placement internally

2024-04-15 Thread Steve Lhomme (@robUx4)


Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
1c46d14f by Steve Lhomme at 2024-04-15T05:51:40+00:00
display: keep the video placement internally

- - - - -
4ab62d06 by Steve Lhomme at 2024-04-15T05:51:40+00:00
display: notify display modules when the picture placement changed

In many cases thats what they really care about. Not the display size or 
display filled value.

- - - - -
0c10d951 by Steve Lhomme at 2024-04-15T05:51:40+00:00
display: remove redundant VOUT_DISPLAY_CHANGE_ZOOM

If the zoom of the video changed, the video placement has changed as well.
Display modules dont actually care about the aspect ratio, just where 
theyre supposed to stretch the video.

- - - - -
65b81371 by Steve Lhomme at 2024-04-15T05:51:40+00:00
display: remove redundant VOUT_DISPLAY_CHANGE_DISPLAY_FILLED

If the display filling mode of the video changed, the video placement has 
changed as well.
Display modules dont actually care about the aspect ratio, just where 
theyre supposed to stretch the video.

- - - - -


22 changed files:

- include/vlc_vout_display.h
- modules/hw/mmal/vout.c
- modules/video_output/android/display.c
- modules/video_output/apple/VLCSampleBufferDisplay.m
- modules/video_output/caca.c
- modules/video_output/caopengllayer.m
- modules/video_output/decklink.cpp
- modules/video_output/drm/display.c
- modules/video_output/flaschen.c
- modules/video_output/kva.c
- modules/video_output/libplacebo/display.c
- modules/video_output/macosx.m
- modules/video_output/opengl/display.c
- modules/video_output/splitter.c
- modules/video_output/vdummy.c
- modules/video_output/vmem.c
- modules/video_output/wayland/shm.c
- modules/video_output/win32/common.c
- modules/video_output/xcb/render.c
- modules/video_output/xcb/x11.c
- modules/video_output/yuv.c
- src/video_output/display.c


Changes:

=
include/vlc_vout_display.h
=
@@ -147,43 +147,34 @@ enum vout_display_query {
 VOUT_DISPLAY_CHANGE_DISPLAY_SIZE,
 
 /**
- * Notifies a change of the display fitting mode by the user.
+ * Notifies a change of the sample aspect ratio.
  *
  * \retval VLC_SUCCESS if the display handled the change
  * \retval VLC_EGENERIC if a \ref vlc_display_operations::reset_pictures
  * request is necessary
  */
-VOUT_DISPLAY_CHANGE_DISPLAY_FILLED,
+VOUT_DISPLAY_CHANGE_SOURCE_ASPECT,
 
 /**
- * Notifies a change of the user zoom factor.
+ * Notifies a change of the source cropping.
  *
- * \retval VLC_SUCCESS if the display handled the change
- * \retval VLC_EGENERIC if a \ref vlc_display_operations::reset_pictures
- * request is necessary
- */
-VOUT_DISPLAY_CHANGE_ZOOM,
-
-/**
- * Notifies a change of the sample aspect ratio.
+ * The cropping requested is stored by source \ref video_format_t 
`i_x`/`y_offset`
+ * and `i_visible_width`/`height`
  *
  * \retval VLC_SUCCESS if the display handled the change
  * \retval VLC_EGENERIC if a \ref vlc_display_operations::reset_pictures
  * request is necessary
  */
-VOUT_DISPLAY_CHANGE_SOURCE_ASPECT,
+VOUT_DISPLAY_CHANGE_SOURCE_CROP,
 
 /**
- * Notifies a change of the source cropping.
- *
- * The cropping requested is stored by source \ref video_format_t 
`i_x`/`y_offset`
- * and `i_visible_width`/`height`
+ * Notified when the source placement in the display has changed
  *
  * \retval VLC_SUCCESS if the display handled the change
  * \retval VLC_EGENERIC if a \ref vlc_display_operations::reset_pictures
  * request is necessary
  */
-VOUT_DISPLAY_CHANGE_SOURCE_CROP,
+VOUT_DISPLAY_CHANGE_SOURCE_PLACE,
 };
 
 /**
@@ -294,10 +285,9 @@ struct vlc_display_operations
  * Reset the picture format handled by the module.
  * This occurs after a
  * \ref VOUT_DISPLAY_CHANGE_DISPLAY_SIZE,
- * \ref VOUT_DISPLAY_CHANGE_DISPLAY_FILLED,
- * \ref VOUT_DISPLAY_CHANGE_ZOOM,
- * \ref VOUT_DISPLAY_CHANGE_SOURCE_ASPECT or
- * \ref VOUT_DISPLAY_CHANGE_SOURCE_CROP
+ * \ref VOUT_DISPLAY_CHANGE_SOURCE_ASPECT,
+ * \ref VOUT_DISPLAY_CHANGE_SOURCE_CROP or
+ * \ref VOUT_DISPLAY_CHANGE_SOURCE_PLACE
  * control query returns an error.
  *
  * \param ftmp video format that the module expects as input


=
modules/hw/mmal/vout.c
=
@@ -689,17 +689,13 @@ static int vd_control(vout_display_t *vd, int query)
 case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE:
 case VOUT_DISPLAY_CHANGE_SOURCE_ASPECT:
 case VOUT_DISPLAY_CHANGE_SOURCE_CROP:
+case VOUT_DISPLAY_CHANGE_SOURCE_PLACE:
 {
 if (configure_display(vd, vd->source) >= 0)
 ret = VLC_SUCCESS;
 break;
 }
 
-case VOUT_DISPLAY_CHANGE_ZOOM:
-msg_Warn(vd, "Unsupported control