2009-07-30 21:47:54 +04:00
|
|
|
/*
|
* Indentation and naming cleanup in the header
* Small coding style cleanups in the .cpp
* When reading raw chunks, keep fCurrentFrame updated anyway
* When decoding frames and chunks, don't change the meaning of fCurrentTime,
it's supposed to be the start time of the next chunk/frame, same as
CurrentFrame(), not the time of the frame/chunk we just decoded/read.
BMediaTrack::CurrentFrame() is actually documented like this in the BeBook,
but CurrentTime() is not. However, when seeking to a specific time, it is
understood that this is the time of the next frame/chunk. If we decode/read
it and set fCurrentTime to the start_time as specified in the media_header,
it would actually not change for the first frame/chunk after seeking.
To be able to know the duration of chunks, fWriterFormat had to be changed
to just fFormat and is now used for decoding as well.
* Simplified handling of media_header in some methods, saves one assignment.
These changes are not so well tested, yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-07 03:55:55 +03:00
|
|
|
* Copyright 2002-2010, Haiku, Inc. All rights reserved.
|
|
|
|
* Distributed under the terms of the MIT License.
|
2009-07-30 21:47:54 +04:00
|
|
|
*/
|
2002-07-09 16:24:59 +04:00
|
|
|
#ifndef _MEDIA_TRACK_H
|
|
|
|
#define _MEDIA_TRACK_H
|
|
|
|
|
2009-07-30 21:47:54 +04:00
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
#include <MediaFormats.h>
|
|
|
|
|
2009-07-30 21:47:54 +04:00
|
|
|
|
|
|
|
namespace BPrivate { namespace media {
|
|
|
|
class Decoder;
|
|
|
|
class Encoder;
|
|
|
|
class MediaExtractor;
|
2002-07-09 16:24:59 +04:00
|
|
|
class MediaWriter;
|
2009-07-30 21:47:54 +04:00
|
|
|
} }
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
class BView;
|
|
|
|
class BParameterWeb;
|
|
|
|
|
2009-07-30 21:47:54 +04:00
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
enum media_seek_type {
|
2009-07-30 21:47:54 +04:00
|
|
|
B_MEDIA_SEEK_CLOSEST_FORWARD = 1,
|
|
|
|
B_MEDIA_SEEK_CLOSEST_BACKWARD = 2,
|
|
|
|
B_MEDIA_SEEK_DIRECTION_MASK = 3
|
2002-07-09 16:24:59 +04:00
|
|
|
};
|
|
|
|
|
2009-07-30 21:47:54 +04:00
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
// BMediaTrack gives access to a particular media track in a media file
|
|
|
|
// (as represented by BMediaFile).
|
|
|
|
//
|
|
|
|
// You always instantiate a BMediaTrack through BMediaFile::TrackAt()
|
|
|
|
// or BMediaFile::CreateTrack(). When a BMediaTrack object is
|
|
|
|
// constructed it finds the necessary decoder or encoder for the type
|
|
|
|
// of data stored in the track.
|
|
|
|
//
|
|
|
|
// Unless you created the BMediaFile() in B_MEDIA_REPLACE_MODE, you
|
|
|
|
// can only access a track for reading or writing, not both.
|
|
|
|
//
|
|
|
|
// If InitCheck() indicates no errors, then the track is ready to be
|
|
|
|
// used to read and write frames using ReadFrames() and WriteFrames().
|
|
|
|
// For video data you should always only read one frame.
|
|
|
|
//
|
|
|
|
// You can seek a track with SeekToTime() and SeekToFrame().
|
|
|
|
//
|
|
|
|
// If no codec could be found for the track, it is still possible to
|
|
|
|
// access the encoded data using ReadChunk().
|
|
|
|
class BMediaTrack {
|
|
|
|
protected:
|
|
|
|
// Use BMediaFile::ReleaseTrack() instead -- or it will go away
|
|
|
|
// on its own when the MediaFile is deleted.
|
2009-07-30 21:47:54 +04:00
|
|
|
virtual ~BMediaTrack();
|
2009-08-05 14:11:06 +04:00
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
public:
|
|
|
|
|
|
|
|
// for read-only access the BMediaTrack should be instantiated
|
|
|
|
// through BMediaFile::TrackAt()
|
|
|
|
|
|
|
|
// for write-only access the BMediaTrack should be instantiated
|
|
|
|
// through BMediaFile::CreateTrack()
|
|
|
|
|
2009-07-30 21:47:54 +04:00
|
|
|
status_t InitCheck() const;
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
// Get information about the codec being used.
|
* Indentation and naming cleanup in the header
* Small coding style cleanups in the .cpp
* When reading raw chunks, keep fCurrentFrame updated anyway
* When decoding frames and chunks, don't change the meaning of fCurrentTime,
it's supposed to be the start time of the next chunk/frame, same as
CurrentFrame(), not the time of the frame/chunk we just decoded/read.
BMediaTrack::CurrentFrame() is actually documented like this in the BeBook,
but CurrentTime() is not. However, when seeking to a specific time, it is
understood that this is the time of the next frame/chunk. If we decode/read
it and set fCurrentTime to the start_time as specified in the media_header,
it would actually not change for the first frame/chunk after seeking.
To be able to know the duration of chunks, fWriterFormat had to be changed
to just fFormat and is now used for decoding as well.
* Simplified handling of media_header in some methods, saves one assignment.
These changes are not so well tested, yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-07 03:55:55 +03:00
|
|
|
status_t GetCodecInfo(
|
|
|
|
media_codec_info* _codecInfo) const;
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2009-08-05 14:11:06 +04:00
|
|
|
|
|
|
|
// EncodedFormat returns information about the track's
|
|
|
|
// "native" encoded format.
|
2002-07-09 16:24:59 +04:00
|
|
|
|
* Indentation and naming cleanup in the header
* Small coding style cleanups in the .cpp
* When reading raw chunks, keep fCurrentFrame updated anyway
* When decoding frames and chunks, don't change the meaning of fCurrentTime,
it's supposed to be the start time of the next chunk/frame, same as
CurrentFrame(), not the time of the frame/chunk we just decoded/read.
BMediaTrack::CurrentFrame() is actually documented like this in the BeBook,
but CurrentTime() is not. However, when seeking to a specific time, it is
understood that this is the time of the next frame/chunk. If we decode/read
it and set fCurrentTime to the start_time as specified in the media_header,
it would actually not change for the first frame/chunk after seeking.
To be able to know the duration of chunks, fWriterFormat had to be changed
to just fFormat and is now used for decoding as well.
* Simplified handling of media_header in some methods, saves one assignment.
These changes are not so well tested, yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-07 03:55:55 +03:00
|
|
|
status_t EncodedFormat(media_format* _format) const;
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
// DecodedFormat is used to negotiate the format that the codec will
|
|
|
|
// use when decoding the track's data. You pass in the format that
|
|
|
|
// that you want; the codec will find and return its "best fit"
|
2009-08-05 14:11:06 +04:00
|
|
|
// format. (inout_format is used as both the input and the returned
|
|
|
|
// format.) The format is typically of the B_MEDIA_RAW_AUDIO or
|
2002-07-09 16:24:59 +04:00
|
|
|
// B_MEDIA_RAW_VIDEO flavor.
|
|
|
|
// The data returned through ReadFrames() will be in the format that's
|
|
|
|
// returned by this function.
|
|
|
|
|
* Indentation and naming cleanup in the header
* Small coding style cleanups in the .cpp
* When reading raw chunks, keep fCurrentFrame updated anyway
* When decoding frames and chunks, don't change the meaning of fCurrentTime,
it's supposed to be the start time of the next chunk/frame, same as
CurrentFrame(), not the time of the frame/chunk we just decoded/read.
BMediaTrack::CurrentFrame() is actually documented like this in the BeBook,
but CurrentTime() is not. However, when seeking to a specific time, it is
understood that this is the time of the next frame/chunk. If we decode/read
it and set fCurrentTime to the start_time as specified in the media_header,
it would actually not change for the first frame/chunk after seeking.
To be able to know the duration of chunks, fWriterFormat had to be changed
to just fFormat and is now used for decoding as well.
* Simplified handling of media_header in some methods, saves one assignment.
These changes are not so well tested, yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-07 03:55:55 +03:00
|
|
|
status_t DecodedFormat(media_format* _inOutFormat,
|
|
|
|
uint32 flags = 0);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
// CountFrames and Duration return the total number of frame and the
|
|
|
|
// total duration (expressed in microseconds) of a track.
|
|
|
|
|
* Indentation and naming cleanup in the header
* Small coding style cleanups in the .cpp
* When reading raw chunks, keep fCurrentFrame updated anyway
* When decoding frames and chunks, don't change the meaning of fCurrentTime,
it's supposed to be the start time of the next chunk/frame, same as
CurrentFrame(), not the time of the frame/chunk we just decoded/read.
BMediaTrack::CurrentFrame() is actually documented like this in the BeBook,
but CurrentTime() is not. However, when seeking to a specific time, it is
understood that this is the time of the next frame/chunk. If we decode/read
it and set fCurrentTime to the start_time as specified in the media_header,
it would actually not change for the first frame/chunk after seeking.
To be able to know the duration of chunks, fWriterFormat had to be changed
to just fFormat and is now used for decoding as well.
* Simplified handling of media_header in some methods, saves one assignment.
These changes are not so well tested, yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-07 03:55:55 +03:00
|
|
|
int64 CountFrames() const;
|
|
|
|
bigtime_t Duration() const;
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
// CurrentFrame and CurrentTime return the current position (expressed in
|
|
|
|
// microseconds) within the track, expressed in frame index and time.
|
|
|
|
|
* Indentation and naming cleanup in the header
* Small coding style cleanups in the .cpp
* When reading raw chunks, keep fCurrentFrame updated anyway
* When decoding frames and chunks, don't change the meaning of fCurrentTime,
it's supposed to be the start time of the next chunk/frame, same as
CurrentFrame(), not the time of the frame/chunk we just decoded/read.
BMediaTrack::CurrentFrame() is actually documented like this in the BeBook,
but CurrentTime() is not. However, when seeking to a specific time, it is
understood that this is the time of the next frame/chunk. If we decode/read
it and set fCurrentTime to the start_time as specified in the media_header,
it would actually not change for the first frame/chunk after seeking.
To be able to know the duration of chunks, fWriterFormat had to be changed
to just fFormat and is now used for decoding as well.
* Simplified handling of media_header in some methods, saves one assignment.
These changes are not so well tested, yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-07 03:55:55 +03:00
|
|
|
int64 CurrentFrame() const;
|
|
|
|
bigtime_t CurrentTime() const;
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
// ReadFrames() fills a buffer with the next frames/samples. For a video
|
|
|
|
// track, it decodes the next frame of video in the passed buffer. For
|
|
|
|
// an audio track, it fills the buffers with the next N samples, as
|
|
|
|
// negotiated by DecodedFormat(). However, if it reaches the end of the
|
|
|
|
// file and was not able to fill the whole buffer, it returns a partial
|
|
|
|
// buffer. Upon return, out_frameCount contains the actual number of
|
2009-08-05 14:11:06 +04:00
|
|
|
// frame/samples returned, and the start time for the frame, expressed
|
2002-07-09 16:24:59 +04:00
|
|
|
// in microseconds, is in the media_header structure.
|
|
|
|
|
* Indentation and naming cleanup in the header
* Small coding style cleanups in the .cpp
* When reading raw chunks, keep fCurrentFrame updated anyway
* When decoding frames and chunks, don't change the meaning of fCurrentTime,
it's supposed to be the start time of the next chunk/frame, same as
CurrentFrame(), not the time of the frame/chunk we just decoded/read.
BMediaTrack::CurrentFrame() is actually documented like this in the BeBook,
but CurrentTime() is not. However, when seeking to a specific time, it is
understood that this is the time of the next frame/chunk. If we decode/read
it and set fCurrentTime to the start_time as specified in the media_header,
it would actually not change for the first frame/chunk after seeking.
To be able to know the duration of chunks, fWriterFormat had to be changed
to just fFormat and is now used for decoding as well.
* Simplified handling of media_header in some methods, saves one assignment.
These changes are not so well tested, yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-07 03:55:55 +03:00
|
|
|
status_t ReadFrames(void* buffer, int64* _frameCount,
|
|
|
|
media_header* mediaHeader = NULL);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
* Indentation and naming cleanup in the header
* Small coding style cleanups in the .cpp
* When reading raw chunks, keep fCurrentFrame updated anyway
* When decoding frames and chunks, don't change the meaning of fCurrentTime,
it's supposed to be the start time of the next chunk/frame, same as
CurrentFrame(), not the time of the frame/chunk we just decoded/read.
BMediaTrack::CurrentFrame() is actually documented like this in the BeBook,
but CurrentTime() is not. However, when seeking to a specific time, it is
understood that this is the time of the next frame/chunk. If we decode/read
it and set fCurrentTime to the start_time as specified in the media_header,
it would actually not change for the first frame/chunk after seeking.
To be able to know the duration of chunks, fWriterFormat had to be changed
to just fFormat and is now used for decoding as well.
* Simplified handling of media_header in some methods, saves one assignment.
These changes are not so well tested, yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-07 03:55:55 +03:00
|
|
|
status_t ReadFrames(void* buffer, int64* _frameCount,
|
|
|
|
media_header* mediaHeader,
|
|
|
|
media_decode_info* info);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
* Indentation and naming cleanup in the header
* Small coding style cleanups in the .cpp
* When reading raw chunks, keep fCurrentFrame updated anyway
* When decoding frames and chunks, don't change the meaning of fCurrentTime,
it's supposed to be the start time of the next chunk/frame, same as
CurrentFrame(), not the time of the frame/chunk we just decoded/read.
BMediaTrack::CurrentFrame() is actually documented like this in the BeBook,
but CurrentTime() is not. However, when seeking to a specific time, it is
understood that this is the time of the next frame/chunk. If we decode/read
it and set fCurrentTime to the start_time as specified in the media_header,
it would actually not change for the first frame/chunk after seeking.
To be able to know the duration of chunks, fWriterFormat had to be changed
to just fFormat and is now used for decoding as well.
* Simplified handling of media_header in some methods, saves one assignment.
These changes are not so well tested, yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-07 03:55:55 +03:00
|
|
|
status_t ReplaceFrames(const void* buffer,
|
|
|
|
int64* _inOutFrameCount,
|
|
|
|
const media_header* mediaHeader);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
|
|
|
|
// SeekToTime and SeekToFrame are used for seeking to a particular
|
|
|
|
// position in a track, expressed in either frames or microseconds.
|
|
|
|
// They return whatever position they were able to seek to. For example,
|
|
|
|
// a video codec may not be able to seek to arbitrary frames, but only to
|
|
|
|
// key frames. In this case, it would return the closest key frame before
|
|
|
|
// the specified seek point.
|
|
|
|
//
|
|
|
|
// If you want to explicitly seek to the nearest keyframe _before_ this
|
|
|
|
// frame or _after_ this frame, pass B_MEDIA_SEEK_CLOSEST_FORWARD or
|
|
|
|
// B_MEDIA_SEEK_CLOSEST_BACKWARD as the flags field.
|
|
|
|
|
* Indentation and naming cleanup in the header
* Small coding style cleanups in the .cpp
* When reading raw chunks, keep fCurrentFrame updated anyway
* When decoding frames and chunks, don't change the meaning of fCurrentTime,
it's supposed to be the start time of the next chunk/frame, same as
CurrentFrame(), not the time of the frame/chunk we just decoded/read.
BMediaTrack::CurrentFrame() is actually documented like this in the BeBook,
but CurrentTime() is not. However, when seeking to a specific time, it is
understood that this is the time of the next frame/chunk. If we decode/read
it and set fCurrentTime to the start_time as specified in the media_header,
it would actually not change for the first frame/chunk after seeking.
To be able to know the duration of chunks, fWriterFormat had to be changed
to just fFormat and is now used for decoding as well.
* Simplified handling of media_header in some methods, saves one assignment.
These changes are not so well tested, yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-07 03:55:55 +03:00
|
|
|
status_t SeekToTime(bigtime_t* _inOutTime,
|
|
|
|
int32 flags = 0);
|
|
|
|
status_t SeekToFrame(int64* _inOutFrame,
|
|
|
|
int32 flags = 0);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
* Indentation and naming cleanup in the header
* Small coding style cleanups in the .cpp
* When reading raw chunks, keep fCurrentFrame updated anyway
* When decoding frames and chunks, don't change the meaning of fCurrentTime,
it's supposed to be the start time of the next chunk/frame, same as
CurrentFrame(), not the time of the frame/chunk we just decoded/read.
BMediaTrack::CurrentFrame() is actually documented like this in the BeBook,
but CurrentTime() is not. However, when seeking to a specific time, it is
understood that this is the time of the next frame/chunk. If we decode/read
it and set fCurrentTime to the start_time as specified in the media_header,
it would actually not change for the first frame/chunk after seeking.
To be able to know the duration of chunks, fWriterFormat had to be changed
to just fFormat and is now used for decoding as well.
* Simplified handling of media_header in some methods, saves one assignment.
These changes are not so well tested, yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-07 03:55:55 +03:00
|
|
|
status_t FindKeyFrameForTime(bigtime_t* _inOutTime,
|
|
|
|
int32 flags = 0) const;
|
|
|
|
status_t FindKeyFrameForFrame(int64* _inOutFrame,
|
|
|
|
int32 flags = 0) const;
|
2002-07-09 16:24:59 +04:00
|
|
|
|
* Indentation and naming cleanup in the header
* Small coding style cleanups in the .cpp
* When reading raw chunks, keep fCurrentFrame updated anyway
* When decoding frames and chunks, don't change the meaning of fCurrentTime,
it's supposed to be the start time of the next chunk/frame, same as
CurrentFrame(), not the time of the frame/chunk we just decoded/read.
BMediaTrack::CurrentFrame() is actually documented like this in the BeBook,
but CurrentTime() is not. However, when seeking to a specific time, it is
understood that this is the time of the next frame/chunk. If we decode/read
it and set fCurrentTime to the start_time as specified in the media_header,
it would actually not change for the first frame/chunk after seeking.
To be able to know the duration of chunks, fWriterFormat had to be changed
to just fFormat and is now used for decoding as well.
* Simplified handling of media_header in some methods, saves one assignment.
These changes are not so well tested, yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-07 03:55:55 +03:00
|
|
|
// ReadChunk returns, in _buffer, the next _size bytes of
|
2002-07-09 16:24:59 +04:00
|
|
|
// data from the track. The data is not decoded -- it will be
|
|
|
|
// in its native encoded format (as specified by EncodedFormat()).
|
|
|
|
// You can not mix calling ReadChunk() and ReadFrames() -- either
|
|
|
|
// you access the track raw (i.e. with ReadChunk) or you access
|
|
|
|
// it with ReadFrames.
|
|
|
|
|
* Indentation and naming cleanup in the header
* Small coding style cleanups in the .cpp
* When reading raw chunks, keep fCurrentFrame updated anyway
* When decoding frames and chunks, don't change the meaning of fCurrentTime,
it's supposed to be the start time of the next chunk/frame, same as
CurrentFrame(), not the time of the frame/chunk we just decoded/read.
BMediaTrack::CurrentFrame() is actually documented like this in the BeBook,
but CurrentTime() is not. However, when seeking to a specific time, it is
understood that this is the time of the next frame/chunk. If we decode/read
it and set fCurrentTime to the start_time as specified in the media_header,
it would actually not change for the first frame/chunk after seeking.
To be able to know the duration of chunks, fWriterFormat had to be changed
to just fFormat and is now used for decoding as well.
* Simplified handling of media_header in some methods, saves one assignment.
These changes are not so well tested, yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-07 03:55:55 +03:00
|
|
|
status_t ReadChunk(char** _buffer, int32* _size,
|
|
|
|
media_header* mediaHeader = NULL);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// Write-only Functions
|
|
|
|
//
|
* Indentation and naming cleanup in the header
* Small coding style cleanups in the .cpp
* When reading raw chunks, keep fCurrentFrame updated anyway
* When decoding frames and chunks, don't change the meaning of fCurrentTime,
it's supposed to be the start time of the next chunk/frame, same as
CurrentFrame(), not the time of the frame/chunk we just decoded/read.
BMediaTrack::CurrentFrame() is actually documented like this in the BeBook,
but CurrentTime() is not. However, when seeking to a specific time, it is
understood that this is the time of the next frame/chunk. If we decode/read
it and set fCurrentTime to the start_time as specified in the media_header,
it would actually not change for the first frame/chunk after seeking.
To be able to know the duration of chunks, fWriterFormat had to be changed
to just fFormat and is now used for decoding as well.
* Simplified handling of media_header in some methods, saves one assignment.
These changes are not so well tested, yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-07 03:55:55 +03:00
|
|
|
status_t AddCopyright(const char* copyright);
|
|
|
|
status_t AddTrackInfo(uint32 code, const void* data,
|
|
|
|
size_t size, uint32 flags = 0);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
* Indentation and naming cleanup in the header
* Small coding style cleanups in the .cpp
* When reading raw chunks, keep fCurrentFrame updated anyway
* When decoding frames and chunks, don't change the meaning of fCurrentTime,
it's supposed to be the start time of the next chunk/frame, same as
CurrentFrame(), not the time of the frame/chunk we just decoded/read.
BMediaTrack::CurrentFrame() is actually documented like this in the BeBook,
but CurrentTime() is not. However, when seeking to a specific time, it is
understood that this is the time of the next frame/chunk. If we decode/read
it and set fCurrentTime to the start_time as specified in the media_header,
it would actually not change for the first frame/chunk after seeking.
To be able to know the duration of chunks, fWriterFormat had to be changed
to just fFormat and is now used for decoding as well.
* Simplified handling of media_header in some methods, saves one assignment.
These changes are not so well tested, yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-07 03:55:55 +03:00
|
|
|
// Write frameCount of data to the track. This data is passed
|
2002-07-09 16:24:59 +04:00
|
|
|
// through the encoder that was specified when the MediaTrack
|
|
|
|
// was constructed.
|
|
|
|
// Pass B_MEDIA_KEY_FRAME for flags if it is.
|
2009-07-30 21:47:54 +04:00
|
|
|
|
* Indentation and naming cleanup in the header
* Small coding style cleanups in the .cpp
* When reading raw chunks, keep fCurrentFrame updated anyway
* When decoding frames and chunks, don't change the meaning of fCurrentTime,
it's supposed to be the start time of the next chunk/frame, same as
CurrentFrame(), not the time of the frame/chunk we just decoded/read.
BMediaTrack::CurrentFrame() is actually documented like this in the BeBook,
but CurrentTime() is not. However, when seeking to a specific time, it is
understood that this is the time of the next frame/chunk. If we decode/read
it and set fCurrentTime to the start_time as specified in the media_header,
it would actually not change for the first frame/chunk after seeking.
To be able to know the duration of chunks, fWriterFormat had to be changed
to just fFormat and is now used for decoding as well.
* Simplified handling of media_header in some methods, saves one assignment.
These changes are not so well tested, yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-07 03:55:55 +03:00
|
|
|
status_t WriteFrames(const void* data, int32 frameCount,
|
|
|
|
int32 flags = 0);
|
|
|
|
status_t WriteFrames(const void* data, int64 frameCount,
|
|
|
|
media_encode_info* info);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
// Write a raw chunk of (presumably already encoded data) to
|
|
|
|
// the file.
|
|
|
|
// Pass B_MEDIA_KEY_FRAME for flags if it is.
|
2009-07-30 21:47:54 +04:00
|
|
|
|
* Indentation and naming cleanup in the header
* Small coding style cleanups in the .cpp
* When reading raw chunks, keep fCurrentFrame updated anyway
* When decoding frames and chunks, don't change the meaning of fCurrentTime,
it's supposed to be the start time of the next chunk/frame, same as
CurrentFrame(), not the time of the frame/chunk we just decoded/read.
BMediaTrack::CurrentFrame() is actually documented like this in the BeBook,
but CurrentTime() is not. However, when seeking to a specific time, it is
understood that this is the time of the next frame/chunk. If we decode/read
it and set fCurrentTime to the start_time as specified in the media_header,
it would actually not change for the first frame/chunk after seeking.
To be able to know the duration of chunks, fWriterFormat had to be changed
to just fFormat and is now used for decoding as well.
* Simplified handling of media_header in some methods, saves one assignment.
These changes are not so well tested, yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-07 03:55:55 +03:00
|
|
|
status_t WriteChunk(const void* data, size_t size,
|
|
|
|
uint32 flags = 0);
|
|
|
|
status_t WriteChunk(const void* data, size_t size,
|
|
|
|
media_encode_info* info);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
// Flush all buffered encoded datas to disk. You should call it after
|
|
|
|
// writing the last frame to be sure all datas are flushed at the right
|
|
|
|
// offset into the file.
|
* Indentation and naming cleanup in the header
* Small coding style cleanups in the .cpp
* When reading raw chunks, keep fCurrentFrame updated anyway
* When decoding frames and chunks, don't change the meaning of fCurrentTime,
it's supposed to be the start time of the next chunk/frame, same as
CurrentFrame(), not the time of the frame/chunk we just decoded/read.
BMediaTrack::CurrentFrame() is actually documented like this in the BeBook,
but CurrentTime() is not. However, when seeking to a specific time, it is
understood that this is the time of the next frame/chunk. If we decode/read
it and set fCurrentTime to the start_time as specified in the media_header,
it would actually not change for the first frame/chunk after seeking.
To be able to know the duration of chunks, fWriterFormat had to be changed
to just fFormat and is now used for decoding as well.
* Simplified handling of media_header in some methods, saves one assignment.
These changes are not so well tested, yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-07 03:55:55 +03:00
|
|
|
status_t Flush();
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
// These are for controlling the underlying encoder and track parameters
|
2004-08-16 16:44:00 +04:00
|
|
|
// returns a copy of the parameter web
|
* Indentation and naming cleanup in the header
* Small coding style cleanups in the .cpp
* When reading raw chunks, keep fCurrentFrame updated anyway
* When decoding frames and chunks, don't change the meaning of fCurrentTime,
it's supposed to be the start time of the next chunk/frame, same as
CurrentFrame(), not the time of the frame/chunk we just decoded/read.
BMediaTrack::CurrentFrame() is actually documented like this in the BeBook,
but CurrentTime() is not. However, when seeking to a specific time, it is
understood that this is the time of the next frame/chunk. If we decode/read
it and set fCurrentTime to the start_time as specified in the media_header,
it would actually not change for the first frame/chunk after seeking.
To be able to know the duration of chunks, fWriterFormat had to be changed
to just fFormat and is now used for decoding as well.
* Simplified handling of media_header in some methods, saves one assignment.
These changes are not so well tested, yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-07 03:55:55 +03:00
|
|
|
status_t GetParameterWeb(BParameterWeb** _web);
|
|
|
|
status_t GetParameterValue(int32 id, void* value,
|
|
|
|
size_t* size);
|
|
|
|
status_t SetParameterValue(int32 id, const void* value,
|
|
|
|
size_t size);
|
|
|
|
BView* GetParameterView();
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
// This is a simplified control API, only one parameter low=0.0, high=1.0
|
|
|
|
// Return B_ERROR if it's not supported by the current encoder.
|
* Indentation and naming cleanup in the header
* Small coding style cleanups in the .cpp
* When reading raw chunks, keep fCurrentFrame updated anyway
* When decoding frames and chunks, don't change the meaning of fCurrentTime,
it's supposed to be the start time of the next chunk/frame, same as
CurrentFrame(), not the time of the frame/chunk we just decoded/read.
BMediaTrack::CurrentFrame() is actually documented like this in the BeBook,
but CurrentTime() is not. However, when seeking to a specific time, it is
understood that this is the time of the next frame/chunk. If we decode/read
it and set fCurrentTime to the start_time as specified in the media_header,
it would actually not change for the first frame/chunk after seeking.
To be able to know the duration of chunks, fWriterFormat had to be changed
to just fFormat and is now used for decoding as well.
* Simplified handling of media_header in some methods, saves one assignment.
These changes are not so well tested, yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-07 03:55:55 +03:00
|
|
|
status_t GetQuality(float* _quality);
|
|
|
|
status_t SetQuality(float quality);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
* Indentation and naming cleanup in the header
* Small coding style cleanups in the .cpp
* When reading raw chunks, keep fCurrentFrame updated anyway
* When decoding frames and chunks, don't change the meaning of fCurrentTime,
it's supposed to be the start time of the next chunk/frame, same as
CurrentFrame(), not the time of the frame/chunk we just decoded/read.
BMediaTrack::CurrentFrame() is actually documented like this in the BeBook,
but CurrentTime() is not. However, when seeking to a specific time, it is
understood that this is the time of the next frame/chunk. If we decode/read
it and set fCurrentTime to the start_time as specified in the media_header,
it would actually not change for the first frame/chunk after seeking.
To be able to know the duration of chunks, fWriterFormat had to be changed
to just fFormat and is now used for decoding as well.
* Simplified handling of media_header in some methods, saves one assignment.
These changes are not so well tested, yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-07 03:55:55 +03:00
|
|
|
status_t GetEncodeParameters(
|
|
|
|
encode_parameters* parameters) const;
|
|
|
|
status_t SetEncodeParameters(
|
|
|
|
encode_parameters* parameters);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
|
* Indentation and naming cleanup in the header
* Small coding style cleanups in the .cpp
* When reading raw chunks, keep fCurrentFrame updated anyway
* When decoding frames and chunks, don't change the meaning of fCurrentTime,
it's supposed to be the start time of the next chunk/frame, same as
CurrentFrame(), not the time of the frame/chunk we just decoded/read.
BMediaTrack::CurrentFrame() is actually documented like this in the BeBook,
but CurrentTime() is not. However, when seeking to a specific time, it is
understood that this is the time of the next frame/chunk. If we decode/read
it and set fCurrentTime to the start_time as specified in the media_header,
it would actually not change for the first frame/chunk after seeking.
To be able to know the duration of chunks, fWriterFormat had to be changed
to just fFormat and is now used for decoding as well.
* Simplified handling of media_header in some methods, saves one assignment.
These changes are not so well tested, yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-07 03:55:55 +03:00
|
|
|
virtual status_t Perform(int32 code, void* data);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
private:
|
2003-11-24 01:19:21 +03:00
|
|
|
friend class BMediaFile;
|
2009-08-05 14:11:06 +04:00
|
|
|
|
2004-08-16 16:44:00 +04:00
|
|
|
// deprecated, but for BeOS R5 compatibility
|
2009-07-30 21:47:54 +04:00
|
|
|
BParameterWeb* Web();
|
2004-08-16 16:44:00 +04:00
|
|
|
|
2009-08-05 14:11:06 +04:00
|
|
|
// Does nothing, returns B_ERROR, for Zeta compatiblity only
|
* Indentation and naming cleanup in the header
* Small coding style cleanups in the .cpp
* When reading raw chunks, keep fCurrentFrame updated anyway
* When decoding frames and chunks, don't change the meaning of fCurrentTime,
it's supposed to be the start time of the next chunk/frame, same as
CurrentFrame(), not the time of the frame/chunk we just decoded/read.
BMediaTrack::CurrentFrame() is actually documented like this in the BeBook,
but CurrentTime() is not. However, when seeking to a specific time, it is
understood that this is the time of the next frame/chunk. If we decode/read
it and set fCurrentTime to the start_time as specified in the media_header,
it would actually not change for the first frame/chunk after seeking.
To be able to know the duration of chunks, fWriterFormat had to be changed
to just fFormat and is now used for decoding as well.
* Simplified handling of media_header in some methods, saves one assignment.
These changes are not so well tested, yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-07 03:55:55 +03:00
|
|
|
status_t ControlCodec(int32 selector, void* _inOutData,
|
|
|
|
size_t size);
|
2004-08-16 16:44:00 +04:00
|
|
|
|
2009-07-30 21:47:54 +04:00
|
|
|
// For read-only access to a BMediaTrack
|
* Indentation and naming cleanup in the header
* Small coding style cleanups in the .cpp
* When reading raw chunks, keep fCurrentFrame updated anyway
* When decoding frames and chunks, don't change the meaning of fCurrentTime,
it's supposed to be the start time of the next chunk/frame, same as
CurrentFrame(), not the time of the frame/chunk we just decoded/read.
BMediaTrack::CurrentFrame() is actually documented like this in the BeBook,
but CurrentTime() is not. However, when seeking to a specific time, it is
understood that this is the time of the next frame/chunk. If we decode/read
it and set fCurrentTime to the start_time as specified in the media_header,
it would actually not change for the first frame/chunk after seeking.
To be able to know the duration of chunks, fWriterFormat had to be changed
to just fFormat and is now used for decoding as well.
* Simplified handling of media_header in some methods, saves one assignment.
These changes are not so well tested, yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-07 03:55:55 +03:00
|
|
|
BMediaTrack(
|
|
|
|
BPrivate::media::MediaExtractor* extractor,
|
|
|
|
int32 streamIndex);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2009-07-30 21:47:54 +04:00
|
|
|
// For write-only access to a BMediaTrack
|
* Indentation and naming cleanup in the header
* Small coding style cleanups in the .cpp
* When reading raw chunks, keep fCurrentFrame updated anyway
* When decoding frames and chunks, don't change the meaning of fCurrentTime,
it's supposed to be the start time of the next chunk/frame, same as
CurrentFrame(), not the time of the frame/chunk we just decoded/read.
BMediaTrack::CurrentFrame() is actually documented like this in the BeBook,
but CurrentTime() is not. However, when seeking to a specific time, it is
understood that this is the time of the next frame/chunk. If we decode/read
it and set fCurrentTime to the start_time as specified in the media_header,
it would actually not change for the first frame/chunk after seeking.
To be able to know the duration of chunks, fWriterFormat had to be changed
to just fFormat and is now used for decoding as well.
* Simplified handling of media_header in some methods, saves one assignment.
These changes are not so well tested, yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-07 03:55:55 +03:00
|
|
|
BMediaTrack(
|
|
|
|
BPrivate::media::MediaWriter* writer,
|
|
|
|
int32 streamIndex,
|
|
|
|
const media_format* format,
|
|
|
|
const media_codec_info* codecInfo);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
* Indentation and naming cleanup in the header
* Small coding style cleanups in the .cpp
* When reading raw chunks, keep fCurrentFrame updated anyway
* When decoding frames and chunks, don't change the meaning of fCurrentTime,
it's supposed to be the start time of the next chunk/frame, same as
CurrentFrame(), not the time of the frame/chunk we just decoded/read.
BMediaTrack::CurrentFrame() is actually documented like this in the BeBook,
but CurrentTime() is not. However, when seeking to a specific time, it is
understood that this is the time of the next frame/chunk. If we decode/read
it and set fCurrentTime to the start_time as specified in the media_header,
it would actually not change for the first frame/chunk after seeking.
To be able to know the duration of chunks, fWriterFormat had to be changed
to just fFormat and is now used for decoding as well.
* Simplified handling of media_header in some methods, saves one assignment.
These changes are not so well tested, yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-07 03:55:55 +03:00
|
|
|
void SetupWorkaround();
|
|
|
|
bool SetupFormatTranslation(
|
|
|
|
const media_format& from,
|
|
|
|
media_format* _to);
|
2004-02-29 21:53:57 +03:00
|
|
|
|
2009-07-30 21:47:54 +04:00
|
|
|
private:
|
* Indentation and naming cleanup in the header
* Small coding style cleanups in the .cpp
* When reading raw chunks, keep fCurrentFrame updated anyway
* When decoding frames and chunks, don't change the meaning of fCurrentTime,
it's supposed to be the start time of the next chunk/frame, same as
CurrentFrame(), not the time of the frame/chunk we just decoded/read.
BMediaTrack::CurrentFrame() is actually documented like this in the BeBook,
but CurrentTime() is not. However, when seeking to a specific time, it is
understood that this is the time of the next frame/chunk. If we decode/read
it and set fCurrentTime to the start_time as specified in the media_header,
it would actually not change for the first frame/chunk after seeking.
To be able to know the duration of chunks, fWriterFormat had to be changed
to just fFormat and is now used for decoding as well.
* Simplified handling of media_header in some methods, saves one assignment.
These changes are not so well tested, yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-07 03:55:55 +03:00
|
|
|
status_t fInitStatus;
|
2009-07-30 21:47:54 +04:00
|
|
|
BPrivate::media::Decoder* fDecoder;
|
|
|
|
BPrivate::media::Decoder* fRawDecoder;
|
|
|
|
BPrivate::media::MediaExtractor* fExtractor;
|
2002-07-09 16:24:59 +04:00
|
|
|
|
* Indentation and naming cleanup in the header
* Small coding style cleanups in the .cpp
* When reading raw chunks, keep fCurrentFrame updated anyway
* When decoding frames and chunks, don't change the meaning of fCurrentTime,
it's supposed to be the start time of the next chunk/frame, same as
CurrentFrame(), not the time of the frame/chunk we just decoded/read.
BMediaTrack::CurrentFrame() is actually documented like this in the BeBook,
but CurrentTime() is not. However, when seeking to a specific time, it is
understood that this is the time of the next frame/chunk. If we decode/read
it and set fCurrentTime to the start_time as specified in the media_header,
it would actually not change for the first frame/chunk after seeking.
To be able to know the duration of chunks, fWriterFormat had to be changed
to just fFormat and is now used for decoding as well.
* Simplified handling of media_header in some methods, saves one assignment.
These changes are not so well tested, yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-07 03:55:55 +03:00
|
|
|
int32 fStream;
|
|
|
|
int64 fCurrentFrame;
|
|
|
|
bigtime_t fCurrentTime;
|
2002-07-09 16:24:59 +04:00
|
|
|
|
* Indentation and naming cleanup in the header
* Small coding style cleanups in the .cpp
* When reading raw chunks, keep fCurrentFrame updated anyway
* When decoding frames and chunks, don't change the meaning of fCurrentTime,
it's supposed to be the start time of the next chunk/frame, same as
CurrentFrame(), not the time of the frame/chunk we just decoded/read.
BMediaTrack::CurrentFrame() is actually documented like this in the BeBook,
but CurrentTime() is not. However, when seeking to a specific time, it is
understood that this is the time of the next frame/chunk. If we decode/read
it and set fCurrentTime to the start_time as specified in the media_header,
it would actually not change for the first frame/chunk after seeking.
To be able to know the duration of chunks, fWriterFormat had to be changed
to just fFormat and is now used for decoding as well.
* Simplified handling of media_header in some methods, saves one assignment.
These changes are not so well tested, yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-07 03:55:55 +03:00
|
|
|
media_codec_info fCodecInfo;
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2009-07-30 21:47:54 +04:00
|
|
|
BPrivate::media::Encoder* fEncoder;
|
* Indentation and naming cleanup in the header
* Small coding style cleanups in the .cpp
* When reading raw chunks, keep fCurrentFrame updated anyway
* When decoding frames and chunks, don't change the meaning of fCurrentTime,
it's supposed to be the start time of the next chunk/frame, same as
CurrentFrame(), not the time of the frame/chunk we just decoded/read.
BMediaTrack::CurrentFrame() is actually documented like this in the BeBook,
but CurrentTime() is not. However, when seeking to a specific time, it is
understood that this is the time of the next frame/chunk. If we decode/read
it and set fCurrentTime to the start_time as specified in the media_header,
it would actually not change for the first frame/chunk after seeking.
To be able to know the duration of chunks, fWriterFormat had to be changed
to just fFormat and is now used for decoding as well.
* Simplified handling of media_header in some methods, saves one assignment.
These changes are not so well tested, yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-07 03:55:55 +03:00
|
|
|
int32 fEncoderID;
|
2009-07-30 21:47:54 +04:00
|
|
|
BPrivate::media::MediaWriter* fWriter;
|
* Indentation and naming cleanup in the header
* Small coding style cleanups in the .cpp
* When reading raw chunks, keep fCurrentFrame updated anyway
* When decoding frames and chunks, don't change the meaning of fCurrentTime,
it's supposed to be the start time of the next chunk/frame, same as
CurrentFrame(), not the time of the frame/chunk we just decoded/read.
BMediaTrack::CurrentFrame() is actually documented like this in the BeBook,
but CurrentTime() is not. However, when seeking to a specific time, it is
understood that this is the time of the next frame/chunk. If we decode/read
it and set fCurrentTime to the start_time as specified in the media_header,
it would actually not change for the first frame/chunk after seeking.
To be able to know the duration of chunks, fWriterFormat had to be changed
to just fFormat and is now used for decoding as well.
* Simplified handling of media_header in some methods, saves one assignment.
These changes are not so well tested, yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-07 03:55:55 +03:00
|
|
|
media_format fFormat;
|
2009-07-31 14:46:58 +04:00
|
|
|
|
* Indentation and naming cleanup in the header
* Small coding style cleanups in the .cpp
* When reading raw chunks, keep fCurrentFrame updated anyway
* When decoding frames and chunks, don't change the meaning of fCurrentTime,
it's supposed to be the start time of the next chunk/frame, same as
CurrentFrame(), not the time of the frame/chunk we just decoded/read.
BMediaTrack::CurrentFrame() is actually documented like this in the BeBook,
but CurrentTime() is not. However, when seeking to a specific time, it is
understood that this is the time of the next frame/chunk. If we decode/read
it and set fCurrentTime to the start_time as specified in the media_header,
it would actually not change for the first frame/chunk after seeking.
To be able to know the duration of chunks, fWriterFormat had to be changed
to just fFormat and is now used for decoding as well.
* Simplified handling of media_header in some methods, saves one assignment.
These changes are not so well tested, yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-07 03:55:55 +03:00
|
|
|
uint32 fWorkaroundFlags;
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
protected:
|
* Indentation and naming cleanup in the header
* Small coding style cleanups in the .cpp
* When reading raw chunks, keep fCurrentFrame updated anyway
* When decoding frames and chunks, don't change the meaning of fCurrentTime,
it's supposed to be the start time of the next chunk/frame, same as
CurrentFrame(), not the time of the frame/chunk we just decoded/read.
BMediaTrack::CurrentFrame() is actually documented like this in the BeBook,
but CurrentTime() is not. However, when seeking to a specific time, it is
understood that this is the time of the next frame/chunk. If we decode/read
it and set fCurrentTime to the start_time as specified in the media_header,
it would actually not change for the first frame/chunk after seeking.
To be able to know the duration of chunks, fWriterFormat had to be changed
to just fFormat and is now used for decoding as well.
* Simplified handling of media_header in some methods, saves one assignment.
These changes are not so well tested, yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-07 03:55:55 +03:00
|
|
|
int32 EncoderID() { return fEncoderID; };
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
private:
|
* Indentation and naming cleanup in the header
* Small coding style cleanups in the .cpp
* When reading raw chunks, keep fCurrentFrame updated anyway
* When decoding frames and chunks, don't change the meaning of fCurrentTime,
it's supposed to be the start time of the next chunk/frame, same as
CurrentFrame(), not the time of the frame/chunk we just decoded/read.
BMediaTrack::CurrentFrame() is actually documented like this in the BeBook,
but CurrentTime() is not. However, when seeking to a specific time, it is
understood that this is the time of the next frame/chunk. If we decode/read
it and set fCurrentTime to the start_time as specified in the media_header,
it would actually not change for the first frame/chunk after seeking.
To be able to know the duration of chunks, fWriterFormat had to be changed
to just fFormat and is now used for decoding as well.
* Simplified handling of media_header in some methods, saves one assignment.
These changes are not so well tested, yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-07 03:55:55 +03:00
|
|
|
BMediaTrack();
|
|
|
|
BMediaTrack(const BMediaTrack&);
|
|
|
|
BMediaTrack& operator=(const BMediaTrack&);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2009-07-30 21:47:54 +04:00
|
|
|
|
* Indentation and naming cleanup in the header
* Small coding style cleanups in the .cpp
* When reading raw chunks, keep fCurrentFrame updated anyway
* When decoding frames and chunks, don't change the meaning of fCurrentTime,
it's supposed to be the start time of the next chunk/frame, same as
CurrentFrame(), not the time of the frame/chunk we just decoded/read.
BMediaTrack::CurrentFrame() is actually documented like this in the BeBook,
but CurrentTime() is not. However, when seeking to a specific time, it is
understood that this is the time of the next frame/chunk. If we decode/read
it and set fCurrentTime to the start_time as specified in the media_header,
it would actually not change for the first frame/chunk after seeking.
To be able to know the duration of chunks, fWriterFormat had to be changed
to just fFormat and is now used for decoding as well.
* Simplified handling of media_header in some methods, saves one assignment.
These changes are not so well tested, yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-07 03:55:55 +03:00
|
|
|
double _FrameRate() const;
|
2009-07-30 21:47:54 +04:00
|
|
|
|
|
|
|
// FBC data and virtuals
|
* Indentation and naming cleanup in the header
* Small coding style cleanups in the .cpp
* When reading raw chunks, keep fCurrentFrame updated anyway
* When decoding frames and chunks, don't change the meaning of fCurrentTime,
it's supposed to be the start time of the next chunk/frame, same as
CurrentFrame(), not the time of the frame/chunk we just decoded/read.
BMediaTrack::CurrentFrame() is actually documented like this in the BeBook,
but CurrentTime() is not. However, when seeking to a specific time, it is
understood that this is the time of the next frame/chunk. If we decode/read
it and set fCurrentTime to the start_time as specified in the media_header,
it would actually not change for the first frame/chunk after seeking.
To be able to know the duration of chunks, fWriterFormat had to be changed
to just fFormat and is now used for decoding as well.
* Simplified handling of media_header in some methods, saves one assignment.
These changes are not so well tested, yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-07 03:55:55 +03:00
|
|
|
uint32 _reserved_BMediaTrack_[31];
|
|
|
|
|
|
|
|
virtual status_t _Reserved_BMediaTrack_0(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_1(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_2(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_3(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_4(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_5(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_6(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_7(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_8(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_9(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_10(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_11(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_12(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_13(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_14(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_15(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_16(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_17(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_18(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_19(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_20(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_21(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_22(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_23(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_24(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_25(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_26(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_27(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_28(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_29(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_30(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_31(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_32(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_33(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_34(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_35(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_36(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_37(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_38(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_39(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_40(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_41(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_42(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_43(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_44(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_45(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_46(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BMediaTrack_47(int32 arg, ...);
|
2002-07-09 16:24:59 +04:00
|
|
|
};
|
|
|
|
|
* Indentation and naming cleanup in the header
* Small coding style cleanups in the .cpp
* When reading raw chunks, keep fCurrentFrame updated anyway
* When decoding frames and chunks, don't change the meaning of fCurrentTime,
it's supposed to be the start time of the next chunk/frame, same as
CurrentFrame(), not the time of the frame/chunk we just decoded/read.
BMediaTrack::CurrentFrame() is actually documented like this in the BeBook,
but CurrentTime() is not. However, when seeking to a specific time, it is
understood that this is the time of the next frame/chunk. If we decode/read
it and set fCurrentTime to the start_time as specified in the media_header,
it would actually not change for the first frame/chunk after seeking.
To be able to know the duration of chunks, fWriterFormat had to be changed
to just fFormat and is now used for decoding as well.
* Simplified handling of media_header in some methods, saves one assignment.
These changes are not so well tested, yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-07 03:55:55 +03:00
|
|
|
#endif // _MEDIA_TRACK_H
|