Implemented support for get_next_encoder() variations from MediaFormats.h.

The AddOnManager in the media_server registers one encoder entry per
successful EncoderPlugin::RegisterNextEncoder(). This gives us a first idea
what media_format_family and input/output media_type is supported. The
mechanism may have to be extended, or the Encoder needs an API to specialize
a format further. In that case, the get_next_encoder() version that takes
optional _acceptedInput/OutputFormat needs to instantiate the plugin and
needs to ask the Encoder. But AFAIK, no app uses it like that anyway.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32005 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2009-07-31 00:46:36 +00:00
parent 061d2ed1a2
commit 6033e52a83
10 changed files with 232 additions and 60 deletions
+12 -11
View File
@@ -30,6 +30,13 @@ public:
Encoder();
virtual ~Encoder();
// TODO: I think we may actually need a method to specialize a
// media_format. For example, some codecs may only support certain
// input color spaces, or output color spaces, or multiple of 16
// width/height... This support is technically even needed for
// MediaFormats.h functionality, although there probably isn't
// an application out there which uses it like that.
virtual status_t SetFormat(const media_file_format& fileFormat,
media_format* _inOutEncodedFormat) = 0;
@@ -75,17 +82,11 @@ public:
virtual Encoder* NewEncoder(
const media_codec_info& codecInfo) = 0;
// TODO: Maybe this also needs to return a media_format with wild cards
// so that we can support the respective get_next_encoder() functions
// that take media_formats with wild cards and specialize them.
// Then this interface could be turned into an iterator like interface:
//
// status_t GetNextSupportedCodec(int32* cookie,
// const media_codec_info* codecInfo,
// const media_format* format) = 0;
virtual status_t GetSupportedCodecs(
const media_codec_info** codecInfos,
size_t* count) = 0;
virtual status_t RegisterNextEncoder(int32* cookie,
media_codec_info* codecInfo,
media_format_family* formatFamily,
media_format* inputFormat,
media_format* outputFormat) = 0;
};
} } // namespace BPrivate::media