The Media Kit Table of Contents | The Media Kit Index |
Derived from: none
Declared in: be/media/MediaFormats.h
Library: libmedia.so
Allocation: Constructor only
The BMediaFormat class provides a means for translating between BeOS media format identifiers and those used by the codecs themselves. This is primarily useful if you're writing a codec add-on or a file format parser.
The BMediaFormats class currently knows how to translate among the following formats' codec identification methods:
|
Constructor. Call InitCheck() to ensure that the object was initialized properly after you instantiate it.
|
Destructor.
|
GetBeOSFormatFor() returns in outFormat a media_format structure that describes the media format corresponding to the given BeOS format ID and media_type.
GetAVIFormatFor() returns in outFormat a media_format structure that describes the media format corresponding to the given AVI format ID and media_type.
GetQuicktimeormatFor() returns in outFormat a media_format structure that describes the media format corresponding to the given QuickTime vendor ID, codec ID, and media_type.
RETURN CODES
B_OK. No error.
|
Given the specified media format, returns in outDescription the media format description for the specified format family.
RETURN CODES
B_OK. No error.
|
Returns in outFormat a media_format structure that describes the media format specified by description. This lets you easily obtain a media_format structure from file-native description information.
RETURN CODES
B_OK. No error.
|
Fills outFormat and outDescription with the media_format and media_format_description of the next supported media format.
RETURN CODES
B_OK. No error.
|
Returns the status code from the constructor; you should call this to be sure the object was properly initialized before issuing any other calls.
RETURN CODES
B_OK. The object is ready to use.
|
Lock() locks the BMediaFormats object so you can use it with the assurance that it won't change while you're working. You should call this before using any of the other BMediaFormats functions. Returns true if it's safe to use the BMediaFormats object; otherwise returns false.
Unlock() releases the BMediaFormats object when you're done with it; be sure to call it when you've finished your work.
|
|
Given the media format descriptions in the descriptions array, the number of descriptions in the list, descCount, and the media_format ioFormat, registers your format description and supported media_format with the Media Kit, and returns a media_format you can use from then on.
This function is called to let the Media Server assign you an encoding value for your media_format_description. If you're implementing a codec add-on or a file parser, you should call this function to let the Media Kit know what you handle.
RETURN CODES
B_OK. No error.
|
Resets format scanning to the first supported format; this causes GetNextFormat() to start at the beginning of the list.
RETURN CODES
B_OK. The object is ready to use.
Declared in: <be/media/MediaFormats.h>
These constants provide options for how to go about adding new formats.
Declared in: <be/media/MediaDefs.h>
Constant | Meaning |
---|---|
B_ANY_FORMAT_FAMILY | Any family. |
B_BEOS_FORMAT_FAMILY | BeOS format. |
B_QUICKTIME_FORMAT_FAMILY | QuickTime format. |
B_AVI_FORMAT_FAMILY | AVI format. |
B_ASF_FORMAT_FAMILY | ASF format. |
B_MISC_FORMAT_FAMILY | Miscellaneous (includes MPEG) |
These constants indicate the media format families the BMediaFormats class can map among.
Declared in: <be/media/MediaFormats.h>
typedef struct { uint32 codec; } media_aiff_description;
Describes the format of media data as an AIFF codec ID.
Declared in: <be/media/MediaFormats.h>
typedef struct { GUID guid; } media_asf_description;
Describes the format of media data as a 128-bit ASF GUID.
Declared in: <be/media/MediaFormats.h>
typedef struct { uint32 codec; } media_avi_description;
Describes the format of media data as an AVI codec ID.
Declared in: <be/media/MediaFormats.h>
typedef struct { uint32 id; } media_avr_description;
Describes the format of media data as an AVR codec ID.
Declared in: <be/media/MediaFormats.h>
typedef struct { int32 format; } media_beos_description;
Describes the format of media data in a way the BeOS Media Kit understands and appreciates. The format field has no predetermined meaning; it's a magic number that only the Media Kit understands.
Declared in: <be/media/MediaFormats.h>
struct encoder_info { char pretty_name[96]; char short_name[32]; int32 id; int32 sub_id; int32 pad[63]; };
Provides information about an encoder. The pretty_name is a complete human-readable name (such as "SuperSqueeze by Applied Interdynamic Systems, Inc."), and the short_name is a short-form version of the encoder's name (such as "SuperSqueeze").
The id is an opaque ID number that gets passed to BMediaFile::AddTrack() so the track can identify the encoder.
The padding is reserved space for future expansion of the structure.
Declared in: <be/media/MediaFormats.h>
struct media_file_format_info { char mimetype[64]; char pretty_name[64]; char short_name[32]; char file_extension[8]; media_format_family family; int64 capabilities; int32 id; int32 pad[64]; };
Describes a media file format. This is used when using BMediaFile objects to determine the type of media file being used.
Declared in: <be/media/MediaFormats.h>
typedef struct _media_format_description { #if defined(__cplusplus) _media_format_description(); ~_media_format_description(); _media_format_description(const _media_format_description &other); _media_format_description & operator=(const _media_format_description &other); #endif media_format_family family; uint32 _reserved_[3]; union { media_beos_description beos; media_quicktime_description quicktime; media_avi_description avi; media_asf_description asf; media_mpeg_description mpeg; media_wav_description wav; media_aiff_description aiff; media_misc_description misc; media_avr_description avr; uint32 _reserved_[12]; } u; } media_format_description;
Describes a media format. The family indicates which media family in the union the description uses to identify the format.
Declared in: <be/media/MediaFormats.h>
typedef struct { uint32 file_format; uint32 codec; } media_misc_description;
Describes the format of a miscellaneous media file.
Declared in: <be/media/MediaFormats.h>
typedef struct { uint32 id; } media_mpeg_description;
Describes the format of media data as an MPEG format ID; this can be any of the following values:
Declared in: <be/media/MediaFormats.h>
typedef struct { uint32 file_format; uint32 codec; } media_misc_description;
Describes the format of media data as a file format/codec pair.
Declared in: <be/media/MediaFormats.h>
typedef struct { uint32 codec; } media_wav_description;
Describes the format of media data as a WAV codec ID.
|
Returns true if the given media_file_format can contain data in the specified media_format. Otherwise, false is returned.
|
Given a media_file_format, mfi, describing the format of a media file, a media_format, outputFormat, describing the desired output format, and optionally a media_format inputFormat describing the desired input format, returns in codecInfo information about the next encoder capable of handling the format.
You should set the int32 pointed to by cookie to 0 initially, and pass the same pointer each time you call get_next_encoder(), to scan through all possible encoders. When there are no more encoders left to check, B_BAD_INDEX is returned.
If you use the second form of this function, on return the acceptedInputFormat and acceptedOutputFormat media_format structures will be filled out to indicate the formats that the codec will accept. This form of the function supports wildcards, while the first does not.
The third form of the function is less specific, and can be used to get a complete list of codecs. This can be handy if you're constructing a user interface to allow the user to select the codec they'd like to use, to get a full list of all the possible formats they can create.
RETURN CODES
B_OK. An encoder was found and returned.
See also: get_next_file_format() in the global C functions section.
The Media Kit Table of Contents | The Media Kit Index |
Copyright © 2000 Be, Inc. All rights reserved..