stream_parser_factory.h revision 2a99a7e74a7f215066514fe81d2bfa6639d9eddd
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 <string>
9#include <vector>
10
11#include "base/memory/scoped_ptr.h"
12#include "media/base/media_export.h"
13#include "media/base/media_log.h"
14
15namespace media {
16
17class StreamParser;
18
19class MEDIA_EXPORT StreamParserFactory {
20 public:
21  // Checks to see if the specified |type| and |codecs| list are supported.
22  // Returns true if |type| and all codecs listed in |codecs| are supported.
23  static bool IsTypeSupported(
24      const std::string& type, const std::vector<std::string>& codecs);
25
26  // Creates a new StreamParser object if the specified |type| and |codecs| list
27  // are supported. |log_cb| can be used to report errors if there is something
28  // wrong with |type| or the codec IDs in |codecs|.
29  // Returns a new StreamParser object if |type| and all codecs listed in
30  //   |codecs| are supported.
31  //   |has_audio| is true if an audio codec was specified.
32  //   |has_video| is true if a video codec was specified.
33  // Returns NULL otherwise. The values of |has_audio| and |has_video| are
34  //   undefined.
35  static scoped_ptr<media::StreamParser> Create(
36      const std::string& type, const std::vector<std::string>& codecs,
37      const LogCB& log_cb, bool* has_audio, bool* has_video);
38};
39
40}  // namespace media
41
42#endif  // MEDIA_FILTERS_STREAM_PARSER_FACTORY_H_
43