* Fixed warnings when compiled with GCC 4.
* Minor cleanup on the way. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18488 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
6e0e4ca6b2
commit
db942edbe1
@ -25,10 +25,11 @@
|
||||
#ifndef _CHUNK_INDEX_H
|
||||
#define _CHUNK_INDEX_H
|
||||
|
||||
|
||||
#include <SupportDefs.h>
|
||||
|
||||
// Std Headers
|
||||
#include <map.h>
|
||||
#include <map>
|
||||
|
||||
|
||||
struct ChunkIndex {
|
||||
uint32 stream;
|
||||
|
@ -25,15 +25,15 @@
|
||||
#ifndef _MOV_ATOM_H
|
||||
#define _MOV_ATOM_H
|
||||
|
||||
#include "QTStructs.h"
|
||||
|
||||
#include <File.h>
|
||||
#include <MediaDefs.h>
|
||||
#include <MediaFormats.h>
|
||||
#include <SupportDefs.h>
|
||||
|
||||
// Std Headers
|
||||
#include <map.h>
|
||||
#include <map>
|
||||
|
||||
#include "QTStructs.h"
|
||||
|
||||
/*
|
||||
AtomBase
|
||||
|
@ -22,16 +22,20 @@
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include <iostream.h>
|
||||
|
||||
#include <DataIO.h>
|
||||
#include <SupportKit.h>
|
||||
|
||||
#include "MOVParser.h"
|
||||
#include "MOVFileReader.h"
|
||||
|
||||
#include <DataIO.h>
|
||||
#include <SupportKit.h>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
|
||||
extern AtomBase *getAtom(BPositionIO *pStream);
|
||||
|
||||
|
||||
MOVFileReader::MOVFileReader(BPositionIO *pStream)
|
||||
{
|
||||
theStream = pStream;
|
||||
@ -549,36 +553,36 @@ const mov_stream_header *MOVFileReader::StreamFormat(uint32 stream_index)
|
||||
return &theStreamHeader;
|
||||
}
|
||||
|
||||
uint32 MOVFileReader::getChunkSize(uint32 stream_index, uint32 pFrameNo)
|
||||
|
||||
uint32
|
||||
MOVFileReader::getChunkSize(uint32 streamIndex, uint32 frameNumber)
|
||||
{
|
||||
AtomBase *aAtomBase = GetChildAtom(uint32('trak'),stream_index);
|
||||
if (aAtomBase) {
|
||||
TRAKAtom *aTrakAtom = dynamic_cast<TRAKAtom *>(aAtomBase);
|
||||
AtomBase *aAtomBase = GetChildAtom(uint32('trak'), streamIndex);
|
||||
if (aAtomBase == NULL)
|
||||
return 0;
|
||||
|
||||
if (IsAudio(stream_index)) {
|
||||
TRAKAtom *aTrakAtom = dynamic_cast<TRAKAtom *>(aAtomBase);
|
||||
|
||||
// We read audio in chunk by chunk so chunk size is chunk size
|
||||
uint32 ChunkNo = pFrameNo;
|
||||
off_t Chunk_Start = aTrakAtom->getOffsetForChunk(ChunkNo);
|
||||
uint32 ChunkSize = ChunkSize = theChunkSuperIndex.getChunkSize(stream_index,ChunkNo,Chunk_Start);
|
||||
|
||||
return ChunkSize;
|
||||
if (IsAudio(streamIndex)) {
|
||||
// We read audio in chunk by chunk so chunk size is chunk size
|
||||
off_t chunkStart = aTrakAtom->getOffsetForChunk(frameNumber);
|
||||
return theChunkSuperIndex.getChunkSize(streamIndex, frameNumber, chunkStart);
|
||||
}
|
||||
|
||||
if (IsVideo(streamIndex)) {
|
||||
if (frameNumber < aTrakAtom->FrameCount()) {
|
||||
// We read video in Sample by Sample so chunk size is Sample Size
|
||||
uint32 sampleNumber = aTrakAtom->getSampleForFrame(frameNumber);
|
||||
return aTrakAtom->getSizeForSample(sampleNumber);
|
||||
}
|
||||
|
||||
if (IsVideo(stream_index)) {
|
||||
if (pFrameNo < aTrakAtom->FrameCount()) {
|
||||
// We read video in Sample by Sample so chunk size is Sample Size
|
||||
uint32 SampleNo = aTrakAtom->getSampleForFrame(pFrameNo);
|
||||
return aTrakAtom->getSizeForSample(SampleNo);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool MOVFileReader::IsKeyFrame(uint32 stream_index, uint32 pFrameNo)
|
||||
|
||||
bool
|
||||
MOVFileReader::IsKeyFrame(uint32 stream_index, uint32 pFrameNo)
|
||||
{
|
||||
AtomBase *aAtomBase = GetChildAtom(uint32('trak'),stream_index);
|
||||
if (aAtomBase) {
|
||||
|
@ -25,15 +25,16 @@
|
||||
#ifndef _MOV_PARSER_H
|
||||
#define _MOV_PARSER_H
|
||||
|
||||
|
||||
#include "MOVAtom.h"
|
||||
|
||||
#include <File.h>
|
||||
#include <MediaDefs.h>
|
||||
#include <MediaFormats.h>
|
||||
#include <SupportDefs.h>
|
||||
|
||||
// Std Headers
|
||||
#include <map.h>
|
||||
#include <map>
|
||||
|
||||
#include "MOVAtom.h"
|
||||
|
||||
typedef SoundDescriptionV1* SoundDescPtr;
|
||||
typedef std::map<uint32, SoundDescPtr, std::less<uint32> > SoundDescArray;
|
||||
|
@ -22,6 +22,13 @@
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#ifndef QT_STRUCTS_H
|
||||
#define QT_STRUCTS_H
|
||||
|
||||
|
||||
#include <SupportDefs.h>
|
||||
|
||||
|
||||
struct xxxx {
|
||||
uint8 Version;
|
||||
uint8 Flags1;
|
||||
@ -340,3 +347,6 @@ struct VideoDescriptionV0 {
|
||||
uint8 *theVOL;
|
||||
size_t VOLSize;
|
||||
};
|
||||
|
||||
#endif // QT_STRUCTS_H
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user