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:
@@ -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,11 +30,15 @@
|
||||
|
||||
#include "avi.h"
|
||||
|
||||
class OpenDMLStream
|
||||
{
|
||||
class OpenDMLStream {
|
||||
public:
|
||||
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;
|
||||
@@ -59,11 +63,10 @@ public:
|
||||
uint32 frames_per_sec_scale;
|
||||
};
|
||||
|
||||
class OpenDMLParser
|
||||
{
|
||||
class OpenDMLParser {
|
||||
public:
|
||||
OpenDMLParser(BPositionIO *source);
|
||||
~OpenDMLParser();
|
||||
virtual ~OpenDMLParser();
|
||||
|
||||
status_t Init();
|
||||
|
||||
@@ -82,7 +85,8 @@ public:
|
||||
|
||||
private:
|
||||
status_t Parse();
|
||||
status_t ParseChunk_AVI(int number, uint64 start, uint32 size);
|
||||
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);
|
||||
@@ -102,7 +106,6 @@ private:
|
||||
void SetupVideoStreamLength(OpenDMLStream *stream);
|
||||
|
||||
private:
|
||||
|
||||
BPositionIO* fSource;
|
||||
int64 fSize;
|
||||
|
||||
@@ -122,7 +125,7 @@ private:
|
||||
odml_extended_header fOdmlExtendedHeader;
|
||||
bool fOdmlExtendedHeaderValid;
|
||||
|
||||
vector<OpenDMLStream> fStreams;
|
||||
std::vector<OpenDMLStream> fStreams;
|
||||
OpenDMLStream * fCurrentStream;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user