[vlc-commits] vout: define crop configuration as a type
Rémi Denis-Courmont
git at videolan.org
Mon Feb 8 15:14:58 UTC 2021
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Feb 6 16:31:45 2021 +0200| [99d330411073b83f72b8c545d3aa57f0907820ff] | committer: Rémi Denis-Courmont
vout: define crop configuration as a type
This creates a separate structure type for the crop configuration.
No functional changes.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=99d330411073b83f72b8c545d3aa57f0907820ff
---
src/video_output/video_output.c | 22 +---------------------
src/video_output/vout_internal.h | 23 +++++++++++++++++++++++
2 files changed, 24 insertions(+), 21 deletions(-)
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 323b40c084..d01bf880d6 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -82,27 +82,7 @@ typedef struct vout_thread_sys_t
/* */
struct {
vlc_rational_t dar;
- struct {
- enum vout_crop_mode mode;
- union {
- struct {
- unsigned num;
- unsigned den;
- } ratio;
- struct {
- unsigned x;
- unsigned y;
- unsigned width;
- unsigned height;
- } window;
- struct {
- unsigned left;
- unsigned right;
- unsigned top;
- unsigned bottom;
- } border;
- };
- } crop;
+ struct vout_crop crop;
} source;
/* Snapshot interface */
diff --git a/src/video_output/vout_internal.h b/src/video_output/vout_internal.h
index ef92f1c889..a351106224 100644
--- a/src/video_output/vout_internal.h
+++ b/src/video_output/vout_internal.h
@@ -103,6 +103,29 @@ int vout_ChangeSource( vout_thread_t *p_vout, const video_format_t *fmt );
enum vout_crop_mode {
VOUT_CROP_NONE, VOUT_CROP_RATIO, VOUT_CROP_WINDOW, VOUT_CROP_BORDER,
};
+
+struct vout_crop {
+ enum vout_crop_mode mode;
+ union {
+ struct {
+ unsigned num;
+ unsigned den;
+ } ratio;
+ struct {
+ unsigned x;
+ unsigned y;
+ unsigned width;
+ unsigned height;
+ } window;
+ struct {
+ unsigned left;
+ unsigned right;
+ unsigned top;
+ unsigned bottom;
+ } border;
+ };
+};
+
bool GetCropMode(const char *crop_str, enum vout_crop_mode *mode,
unsigned *num, unsigned *den,
unsigned *x, unsigned *y,
More information about the vlc-commits
mailing list