1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef MEDIA_FILTERS_STREAM_PARSER_FACTORY_H_
6 #define MEDIA_FILTERS_STREAM_PARSER_FACTORY_H_
12 #include "media/base/media_export.h"
13 #include "media/base/media_log.h"
14 #include "media/base/mime_util.h"
20 class MEDIA_EXPORT StreamParserFactory {
22 // Checks to see if the specified |type| and |codecs| list are supported.
23 // Returns one of the following SupportsType values:
24 // IsNotSupported indicates definitive lack of support.
25 // IsSupported indicates the mime type is supported, any non-empty codecs
26 // requirement is met for the mime type, and all of the passed codecs are
27 // supported for the mime type.
28 // MayBeSupported indicates the mime type is supported, but the mime type
29 // requires a codecs parameter that is missing.
30 static SupportsType IsTypeSupported(const std::string& type,
31 const std::vector<std::string>& codecs);
33 // Creates a new StreamParser object if the specified |type| and |codecs| list
34 // are supported. |media_log| can be used to report errors if there is
35 // something wrong with |type| or the codec IDs in |codecs|.
36 // Returns a new StreamParser object if |type| and all codecs listed in
37 // |codecs| are supported.
38 // Returns NULL otherwise.
39 static std::unique_ptr<StreamParser> Create(
40 const std::string& type,
41 const std::vector<std::string>& codecs,
47 #endif // MEDIA_FILTERS_STREAM_PARSER_FACTORY_H_