]> git.vomp.tv Git - vompclient-marten.git/blob - audiomvp.h
Fix bug in demuxer widescreen signaling
[vompclient-marten.git] / audiomvp.h
1 /*
2     Copyright 2004-2005 Chris Tallon
3
4     This file is part of VOMP.
5
6     VOMP is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     VOMP is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with VOMP; if not, write to the Free Software
18     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
19 */
20
21 // Thanks to Jon Gettler and BtB for all the ioctl information
22
23 #ifndef AUDIOMVP_H
24 #define AUDIOMVP_H
25
26 #include <stdio.h>
27 #include <unistd.h>
28 #include <fcntl.h>
29 #include <sys/ioctl.h>
30
31 #include "defines.h"
32 #include "audio.h"
33
34 typedef struct
35 {
36   int parm1;
37   int parm2;
38 } aud_sync_parms_t;
39
40 typedef struct
41 {
42   int aud_ctl0;
43   int aud_ctl1;
44   int aud_ctl2;
45 } aud_ctl_regs_t;
46
47 #define AV_SET_AUD_PLAY         _IOW('a', 2, int)
48 #define AV_SET_AUD_PAUSE        _IOW('a', 3, int)
49 #define AV_SET_AUD_UNPAUSE      _IOW('a', 4, int)
50 #define AV_SET_AUD_SRC          _IOW('a', 5, int)
51 #define AV_SET_AUD_MUTE         _IOW('a', 6, int)
52 #define AV_SET_AUD_CHANNEL      _IOW('a', 9, int)
53 #define AV_GET_AUD_INFO         _IOR('a', 10, int)
54 #define AV_SET_AUD_VOLUME       _IOW('a', 13, int)
55 #define AV_GET_AUD_VOLUME       _IOR('a', 14, int)
56 #define AV_SET_AUD_STREAMTYPE   _IOW('a', 15, int)
57 #define AV_SET_AUD_FORMAT       _IOW('a', 16, int)
58 #define AV_GET_AUD_TIMESTAMPS   _IOR('a', 21, sync_data_t*)
59 #define AV_SET_AUD_STC          _IOW('a', 22, uint64_t *)
60 #define AV_SET_AUD_SYNC         _IOW('a', 23, int)
61 #define AV_SET_AUD_DISABLE_SYNC _IOW('a', 24, aud_sync_parms_t*)
62 #define AV_SET_AUD_RESET        _IOW('a', 26, int)
63 #define AV_SET_AUD_DAC_CLK      _IOW('a', 27, int)
64 #define AV_GET_AUD_REGS         _IOW('a', 28, aud_ctl_regs_t*)
65
66
67 class AudioMVP : public Audio
68 {
69   public:
70     AudioMVP();
71     ~AudioMVP();
72
73     int init(UCHAR streamType);
74     int shutdown();
75
76     int setStreamType(UCHAR streamType);
77     int setChannel();
78     int setSource();
79     int sync();
80     int play();
81     int stop();
82     int pause();
83     int unPause();
84     int reset();
85     int setVolume(int volume);
86     int mute();
87     int unMute();
88     bool supportsAc3() { return false; }
89
90     //Writing Data to Audiodevice
91     virtual void PrepareMediaSample(const MediaPacketList&, UINT samplepos);
92     virtual UINT DeliverMediaSample(UCHAR* buffer, UINT *samplepos);
93     virtual long long SetStartOffset(long long curreftime, bool *rsync) { return 0; };
94     virtual void ResetTimeOffsets();
95
96 #ifdef DEV
97     int test();
98 #endif
99
100   private:
101     int initAllParams();
102     UCHAR streamType;
103     int fdAudio;
104
105     MediaPacket packet;
106     UINT packetpos;
107 };
108
109 #endif