2
SMPEG - SDL MPEG Player Library
3
Copyright (C) 1999 Loki Entertainment Software
5
- Modified by Michel Darricau from eProcess <mdarricau@eprocess.fr> for popcorn -
7
This library is free software; you can redistribute it and/or
8
modify it under the terms of the GNU Library General Public
9
License as published by the Free Software Foundation; either
10
version 2 of the License, or (at your option) any later version.
12
This library is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
Library General Public License for more details.
17
You should have received a copy of the GNU Library General Public
18
License along with this library; if not, write to the Free
19
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22
/* A class used to parse and play MPEG streams */
33
#include "MPEGerror.h"
34
#include "MPEGstream.h"
35
#include "MPEGaction.h"
36
#include "MPEGaudio.h"
37
#include "MPEGvideo.h"
38
#include "MPEGsystem.h"
40
#define LENGTH_TO_CHECK_FOR_SYSTEM 0x50000 // Added by HanishKVC
42
/* The main MPEG class - parses system streams and creates other streams
44
Making this derived from MPEGstream allows us to do system stream
45
parsing. We create an additional MPEG object for each type of
46
stream in the MPEG file because each needs a separate pointer to
47
the MPEG data. The MPEG stream then creates an accessor object to
48
do all the data parsing for that stream type. It's a little odd,
49
but seemed like the best way to implement stream parsing.
51
class MPEG : public MPEGerror
54
/* Michel Darricau from eProcess <mdarricau@eprocess.fr> need for override in popcorn */
56
MPEG(bool Sdlaudio, char *addresse,char *asset,long buffersize){}
58
MPEG(const char * name, bool SDLaudio = true);
59
MPEG(int Mpeg_FD, bool SDLaudio = true);
60
MPEG(void *data, int size, bool SDLaudio = true);
61
MPEG(SDL_RWops *mpeg_source, int mpeg_freesrc, bool SDLaudio = true);
64
/* Initialize the MPEG */
65
void Init(SDL_RWops *mpeg_source, int mpeg_freesrc, bool SDLaudio);
66
void InitErrorState();
68
/* Enable/Disable audio and video */
69
bool AudioEnabled(void);
70
void EnableAudio(bool enabled);
71
bool VideoEnabled(void);
72
void EnableVideo(bool enabled);
75
void Loop(bool toggle);
76
/* Michel Darricau from eProcess <mdarricau@eprocess.fr> need for override in popcorn */
77
virtual void Play(void);
80
/* Michel Darricau from eProcess <mdarricau@eprocess.fr> need for override in popcorn */
81
virtual void Pause(void);
82
virtual void Seek(int bytes);
83
void Skip(float seconds);
84
/* Michel Darricau from eProcess <mdarricau@eprocess.fr> need for override in popcorn */
85
MPEGstatus GetStatus(void);
86
void GetSystemInfo(MPEG_SystemInfo *info);
88
/* MPEG audio actions */
89
bool GetAudioInfo(MPEG_AudioInfo *info);
91
bool WantedSpec(SDL_AudioSpec *wanted);
92
void ActualSpec(const SDL_AudioSpec *actual);
93
MPEGaudio *GetAudio(void);
95
/* MPEG video actions */
96
bool GetVideoInfo(MPEG_VideoInfo *info);
97
bool SetDisplay(MPEG_DisplayCallback callback, void *data, SDL_mutex *lock);
98
void RenderFrame(int frame);
102
/* We need to have separate audio and video streams */
103
MPEGstream * audiostream;
104
MPEGstream * videostream;
109
char *mpeg_mem; // Used to copy MPEG passed in as memory
112
MPEGaudioaction *audioaction;
113
MPEGvideoaction *videoaction;
118
bool audioaction_enabled;
119
bool videoaction_enabled;
126
void parse_stream_list();
127
bool seekIntoStream(int position);
130
#endif /* _MPEG_H_ */