summaryrefslogtreecommitdiff
path: root/chromium/media/base/android/demuxer_stream_player_params.h
blob: e5e96f37a69bc782c8c4699c684b5ea9dcc5f77a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef MEDIA_BASE_ANDROID_DEMUXER_STREAM_PLAYER_PARAMS_H_
#define MEDIA_BASE_ANDROID_DEMUXER_STREAM_PLAYER_PARAMS_H_

#include <vector>

#include "media/base/audio_decoder_config.h"
#include "media/base/decrypt_config.h"
#include "media/base/demuxer_stream.h"
#include "media/base/media_export.h"
#include "media/base/video_decoder_config.h"
#include "ui/gfx/geometry/size.h"

namespace media {

struct MEDIA_EXPORT DemuxerConfigs {
  DemuxerConfigs();
  ~DemuxerConfigs();

  AudioCodec audio_codec;
  int audio_channels;
  int audio_sampling_rate;
  bool is_audio_encrypted;
  std::vector<uint8> audio_extra_data;
  int64 audio_codec_delay_ns;
  int64 audio_seek_preroll_ns;

  VideoCodec video_codec;
  gfx::Size video_size;
  bool is_video_encrypted;
  std::vector<uint8> video_extra_data;

  base::TimeDelta duration;
};

struct MEDIA_EXPORT AccessUnit {
  AccessUnit();
  ~AccessUnit();

  DemuxerStream::Status status;
  bool is_end_of_stream;
  // TODO(ycheo): Use the shared memory to transfer the block data.
  std::vector<uint8> data;
  base::TimeDelta timestamp;
  std::vector<char> key_id;
  std::vector<char> iv;
  std::vector<media::SubsampleEntry> subsamples;
  bool is_key_frame;
};

struct MEDIA_EXPORT DemuxerData {
  DemuxerData();
  ~DemuxerData();

  DemuxerStream::Type type;
  std::vector<AccessUnit> access_units;
  // If the last entry in |access_units| has a status equal to |kConfigChanged|,
  // a corresponding DemuxerConfigs is added into this vector. The
  // DemuxerConfigs should only contain information of the stream that is
  // specified by |type|. This solves the issue that we need multiple IPCs when
  // demuxer configs change.
  std::vector<DemuxerConfigs> demuxer_configs;
};

};  // namespace media

// For logging
MEDIA_EXPORT
std::ostream& operator<<(std::ostream& os, const media::AccessUnit& au);

MEDIA_EXPORT
std::ostream& operator<<(std::ostream& os, const media::DemuxerConfigs& conf);

#endif  // MEDIA_BASE_ANDROID_DEMUXER_STREAM_PLAYER_PARAMS_H_