blob: dff60d87e63cf2e93661ed247eb4a3934ee9cbf7 [file] [log] [blame]
philipel2fee4d62018-03-21 16:52:13 +01001/*
2 * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11#ifndef API_VIDEO_VIDEO_STREAM_DECODER_H_
12#define API_VIDEO_VIDEO_STREAM_DECODER_H_
13
14#include <map>
15#include <memory>
16#include <utility>
17
18#include "api/video/encoded_frame.h"
19#include "api/video/video_frame.h"
20#include "api/video_codecs/sdp_video_format.h"
21#include "api/video_codecs/video_decoder_factory.h"
22
23namespace webrtc {
philipel2fee4d62018-03-21 16:52:13 +010024// NOTE: This class is still under development and may change without notice.
25class VideoStreamDecoder {
26 public:
27 class Callbacks {
28 public:
29 virtual ~Callbacks() = default;
30
31 // Called when the VideoStreamDecoder enters a non-decodable state.
32 virtual void OnNonDecodableState() = 0;
33
34 // Called with the last continuous frame.
philipel97187112018-03-23 10:43:21 +010035 virtual void OnContinuousUntil(
36 const video_coding::VideoLayerFrameId& key) = 0;
philipel2fee4d62018-03-21 16:52:13 +010037
38 // Called with the decoded frame.
39 virtual void OnDecodedFrame(VideoFrame decodedImage,
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +020040 absl::optional<int> decode_time_ms,
41 absl::optional<int> qp) = 0;
philipel2fee4d62018-03-21 16:52:13 +010042 };
43
44 virtual ~VideoStreamDecoder() = default;
45
46 virtual void OnFrame(std::unique_ptr<video_coding::EncodedFrame> frame) = 0;
47};
48
49} // namespace webrtc
50
51#endif // API_VIDEO_VIDEO_STREAM_DECODER_H_