This repository has been archived by the owner on Dec 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy pathQmlVlcVideo.h
109 lines (82 loc) · 3.83 KB
/
QmlVlcVideo.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/*******************************************************************************
* Copyright © 2014-2015, Sergey Radionov <rsatom_gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*******************************************************************************/
#pragma once
#include "libvlc_wrapper/vlc_player.h"
#include "QmlVlcMarquee.h"
#include "QmlVlcLogo.h"
#include "QmlVlcDeinterlace.h"
class QmlVlcVideo : public QObject
{
Q_OBJECT
public:
QmlVlcVideo( vlc::player_core& player )
: m_player( player ), m_marquee( player ), m_logo( player ), m_deinterlace( player ) { }
Q_PROPERTY( unsigned width READ get_width )
Q_PROPERTY( unsigned height READ get_height )
Q_PROPERTY( unsigned count READ get_trackCount )
Q_PROPERTY( int track READ get_track WRITE set_track )
Q_PROPERTY( QString aspectRatio READ get_aspectRatio WRITE set_aspectRatio )
Q_PROPERTY( QString crop READ get_crop WRITE set_crop )
Q_PROPERTY( float contrast READ get_contrast WRITE set_contrast )
Q_PROPERTY( float brightness READ get_brightness WRITE set_brightness )
Q_PROPERTY( int hue READ get_hue WRITE set_hue )
Q_PROPERTY( float saturation READ get_saturation WRITE set_saturation )
Q_PROPERTY( float gamma READ get_gamma WRITE set_gamma )
Q_PROPERTY( int teletext READ get_teletext WRITE set_teletext )
Q_PROPERTY( QmlVlcMarquee* marquee READ get_marquee CONSTANT )
Q_PROPERTY( QmlVlcLogo* logo READ get_logo CONSTANT )
Q_PROPERTY( QmlVlcDeinterlace* deinterlace READ get_deinterlace CONSTANT )
unsigned get_width();
unsigned get_height();
unsigned get_trackCount();
int get_track();
void set_track( int idx );
QString get_aspectRatio();
void set_aspectRatio( const QString& );
QString get_crop();
void set_crop( const QString& );
int get_teletext();
void set_teletext( unsigned );
float get_contrast();
void set_contrast( float v );
float get_brightness();
void set_brightness( float v );
int get_hue();
void set_hue( int v );
float get_saturation();
void set_saturation( float v );
float get_gamma();
void set_gamma( float v );
Q_INVOKABLE void toggleTeletext();
QmlVlcMarquee* get_marquee() { return &m_marquee; }
QmlVlcLogo* get_logo() { return &m_logo; }
QmlVlcDeinterlace* get_deinterlace() { return &m_deinterlace; }
private:
void getVideoSize( unsigned* width, unsigned* height );
private:
vlc::player_core& m_player;
QmlVlcMarquee m_marquee;
QmlVlcLogo m_logo;
QmlVlcDeinterlace m_deinterlace;
};