Upload upstream chromium 85.0.4183.84
[platform/framework/web/chromium-efl.git] / media / filters / stream_parser_factory.h
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.
4
5 #ifndef MEDIA_FILTERS_STREAM_PARSER_FACTORY_H_
6 #define MEDIA_FILTERS_STREAM_PARSER_FACTORY_H_
7
8 #include <memory>
9 #include <string>
10 #include <vector>
11
12 #include "media/base/media_export.h"
13 #include "media/base/media_log.h"
14 #include "media/base/mime_util.h"
15
16 namespace media {
17
18 class StreamParser;
19
20 class MEDIA_EXPORT StreamParserFactory {
21  public:
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);
32
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,
42       MediaLog* media_log);
43 };
44
45 }  // namespace media
46
47 #endif  // MEDIA_FILTERS_STREAM_PARSER_FACTORY_H_