Fix GCC 4 build. Implemented constructors/destructors and standard operators.
Hopefully, I am not stepping on your toes, David! Please check these changes, I've added some TODOs where problems may be lurking. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29312 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
8ee9217eec
commit
50d6da5a0e
@ -42,6 +42,67 @@
|
||||
#endif
|
||||
|
||||
|
||||
OpenDMLStream::OpenDMLStream()
|
||||
:
|
||||
is_audio(false),
|
||||
is_video(false),
|
||||
is_subtitle(false),
|
||||
stream_header_valid(false),
|
||||
audio_format_valid(false),
|
||||
audio_format(NULL),
|
||||
audio_format_size(0),
|
||||
video_format_valid(false),
|
||||
odml_index_start(0),
|
||||
odml_index_size(0),
|
||||
duration(0),
|
||||
frame_count(0),
|
||||
frames_per_sec_rate(1),
|
||||
frames_per_sec_scale(1)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
OpenDMLStream::OpenDMLStream(const OpenDMLStream& other)
|
||||
{
|
||||
*this = other;
|
||||
}
|
||||
|
||||
|
||||
OpenDMLStream::~OpenDMLStream()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
OpenDMLStream&
|
||||
OpenDMLStream::operator=(const OpenDMLStream& other)
|
||||
{
|
||||
// TODO: implement for real
|
||||
if (&other != this)
|
||||
memcpy(this, &other, sizeof(OpenDMLStream));
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
OpenDMLStream::operator==(const OpenDMLStream& other) const
|
||||
{
|
||||
// TODO: should probably check "valid" flags
|
||||
if (this == &other)
|
||||
return true;
|
||||
return memcmp(this, &other, sizeof(OpenDMLStream)) == 0;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
OpenDMLStream::operator!=(const OpenDMLStream& other) const
|
||||
{
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark -
|
||||
|
||||
|
||||
OpenDMLParser::OpenDMLParser(BPositionIO *source)
|
||||
: fSource(source),
|
||||
fSize(source->Seek(0, SEEK_END)),
|
||||
@ -111,22 +172,9 @@ void
|
||||
OpenDMLParser::CreateNewStreamInfo()
|
||||
{
|
||||
OpenDMLStream info;
|
||||
|
||||
info.is_audio = false;
|
||||
info.is_video = false;
|
||||
info.stream_header_valid = false;
|
||||
info.audio_format = 0;
|
||||
info.video_format_valid = false;
|
||||
info.odml_index_start = 0;
|
||||
info.odml_index_size = 0;
|
||||
info.duration = 0;
|
||||
info.frame_count = 0;
|
||||
info.frames_per_sec_rate = 1;
|
||||
info.frames_per_sec_scale = 1;
|
||||
|
||||
fStreams.push_back(info);
|
||||
|
||||
fCurrentStream = fStreams.last();
|
||||
fCurrentStream = &fStreams[fStreams.size() - 1];// fStreams.last();
|
||||
}
|
||||
|
||||
status_t
|
||||
|
@ -30,100 +30,103 @@
|
||||
|
||||
#include "avi.h"
|
||||
|
||||
class OpenDMLStream
|
||||
{
|
||||
class OpenDMLStream {
|
||||
public:
|
||||
OpenDMLStream();
|
||||
~OpenDMLStream();
|
||||
OpenDMLStream();
|
||||
OpenDMLStream(const OpenDMLStream& other);
|
||||
virtual ~OpenDMLStream();
|
||||
|
||||
OpenDMLStream& operator=(const OpenDMLStream& other);
|
||||
bool operator==(const OpenDMLStream& other) const;
|
||||
bool operator!=(const OpenDMLStream& other) const;
|
||||
|
||||
bool is_audio;
|
||||
bool is_video;
|
||||
bool is_subtitle;
|
||||
bool is_audio;
|
||||
bool is_video;
|
||||
bool is_subtitle;
|
||||
|
||||
bool stream_header_valid;
|
||||
avi_stream_header stream_header;
|
||||
bool stream_header_valid;
|
||||
avi_stream_header stream_header;
|
||||
|
||||
bool audio_format_valid;
|
||||
wave_format_ex *audio_format;
|
||||
size_t audio_format_size;
|
||||
bool audio_format_valid;
|
||||
wave_format_ex* audio_format;
|
||||
size_t audio_format_size;
|
||||
|
||||
bool video_format_valid;
|
||||
bitmap_info_header video_format;
|
||||
bool video_format_valid;
|
||||
bitmap_info_header video_format;
|
||||
|
||||
int64 odml_index_start;
|
||||
uint32 odml_index_size;
|
||||
int64 odml_index_start;
|
||||
uint32 odml_index_size;
|
||||
|
||||
bigtime_t duration;
|
||||
int64 frame_count;
|
||||
uint32 frames_per_sec_rate;
|
||||
uint32 frames_per_sec_scale;
|
||||
bigtime_t duration;
|
||||
int64 frame_count;
|
||||
uint32 frames_per_sec_rate;
|
||||
uint32 frames_per_sec_scale;
|
||||
};
|
||||
|
||||
class OpenDMLParser
|
||||
{
|
||||
class OpenDMLParser {
|
||||
public:
|
||||
OpenDMLParser(BPositionIO *source);
|
||||
~OpenDMLParser();
|
||||
OpenDMLParser(BPositionIO *source);
|
||||
virtual ~OpenDMLParser();
|
||||
|
||||
status_t Init();
|
||||
status_t Init();
|
||||
|
||||
int StreamCount();
|
||||
int StreamCount();
|
||||
|
||||
const OpenDMLStream * StreamInfo(int index);
|
||||
const OpenDMLStream* StreamInfo(int index);
|
||||
|
||||
int64 StandardIndexStart();
|
||||
uint32 StandardIndexSize();
|
||||
int64 StandardIndexStart();
|
||||
uint32 StandardIndexSize();
|
||||
|
||||
int64 MovieListStart();
|
||||
uint32 MovieListSize() {return fMovieListSize;};
|
||||
int64 MovieListStart();
|
||||
uint32 MovieListSize() {return fMovieListSize;};
|
||||
|
||||
const avi_main_header * AviMainHeader();
|
||||
const odml_extended_header * OdmlExtendedHeader();
|
||||
const avi_main_header* AviMainHeader();
|
||||
const odml_extended_header* OdmlExtendedHeader();
|
||||
|
||||
private:
|
||||
status_t Parse();
|
||||
status_t ParseChunk_AVI(int number, uint64 start, uint32 size);
|
||||
status_t ParseChunk_LIST(uint64 start, uint32 size);
|
||||
status_t ParseChunk_idx1(uint64 start, uint32 size);
|
||||
status_t ParseChunk_indx(uint64 start, uint32 size);
|
||||
status_t ParseChunk_avih(uint64 start, uint32 size);
|
||||
status_t ParseChunk_strh(uint64 start, uint32 size);
|
||||
status_t ParseChunk_strf(uint64 start, uint32 size);
|
||||
status_t ParseChunk_strn(uint64 start, uint32 size);
|
||||
status_t ParseChunk_dmlh(uint64 start, uint32 size);
|
||||
status_t ParseList_movi(uint64 start, uint32 size);
|
||||
status_t ParseList_generic(uint64 start, uint32 size);
|
||||
status_t ParseList_INFO(uint64 start, uint32 size);
|
||||
status_t ParseList_strl(uint64 start, uint32 size);
|
||||
status_t Parse();
|
||||
status_t ParseChunk_AVI(int number, uint64 start,
|
||||
uint32 size);
|
||||
status_t ParseChunk_LIST(uint64 start, uint32 size);
|
||||
status_t ParseChunk_idx1(uint64 start, uint32 size);
|
||||
status_t ParseChunk_indx(uint64 start, uint32 size);
|
||||
status_t ParseChunk_avih(uint64 start, uint32 size);
|
||||
status_t ParseChunk_strh(uint64 start, uint32 size);
|
||||
status_t ParseChunk_strf(uint64 start, uint32 size);
|
||||
status_t ParseChunk_strn(uint64 start, uint32 size);
|
||||
status_t ParseChunk_dmlh(uint64 start, uint32 size);
|
||||
status_t ParseList_movi(uint64 start, uint32 size);
|
||||
status_t ParseList_generic(uint64 start, uint32 size);
|
||||
status_t ParseList_INFO(uint64 start, uint32 size);
|
||||
status_t ParseList_strl(uint64 start, uint32 size);
|
||||
|
||||
void CreateNewStreamInfo();
|
||||
void SetupStreamLength(OpenDMLStream *stream);
|
||||
void SetupAudioStreamLength(OpenDMLStream *stream);
|
||||
void SetupVideoStreamLength(OpenDMLStream *stream);
|
||||
void CreateNewStreamInfo();
|
||||
void SetupStreamLength(OpenDMLStream *stream);
|
||||
void SetupAudioStreamLength(OpenDMLStream *stream);
|
||||
void SetupVideoStreamLength(OpenDMLStream *stream);
|
||||
|
||||
private:
|
||||
|
||||
BPositionIO * fSource;
|
||||
int64 fSize;
|
||||
BPositionIO* fSource;
|
||||
int64 fSize;
|
||||
|
||||
// TODO can be multiple Movi Lists
|
||||
int64 fMovieListStart;
|
||||
uint32 fMovieListSize;
|
||||
// TODO can be multiple Movi Lists
|
||||
int64 fMovieListStart;
|
||||
uint32 fMovieListSize;
|
||||
|
||||
int64 fStandardIndexStart;
|
||||
uint32 fStandardIndexSize;
|
||||
int64 fStandardIndexStart;
|
||||
uint32 fStandardIndexSize;
|
||||
|
||||
int fStreamCount;
|
||||
int fMovieChunkCount;
|
||||
int fStreamCount;
|
||||
int fMovieChunkCount;
|
||||
|
||||
avi_main_header fAviMainHeader;
|
||||
bool fAviMainHeaderValid;
|
||||
avi_main_header fAviMainHeader;
|
||||
bool fAviMainHeaderValid;
|
||||
|
||||
odml_extended_header fOdmlExtendedHeader;
|
||||
bool fOdmlExtendedHeaderValid;
|
||||
odml_extended_header fOdmlExtendedHeader;
|
||||
bool fOdmlExtendedHeaderValid;
|
||||
|
||||
vector<OpenDMLStream> fStreams;
|
||||
OpenDMLStream * fCurrentStream;
|
||||
std::vector<OpenDMLStream> fStreams;
|
||||
OpenDMLStream * fCurrentStream;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user