Android-cuttlefish cvd tool
decoder_provider.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2026 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18
19#include <memory>
20#include <string>
21#include <vector>
22
23#include "api/video_codecs/sdp_video_format.h"
24#include "api/video_codecs/video_decoder.h"
25
27
28namespace cuttlefish {
29namespace webrtc_streaming {
30
31// Interface for pluggable video decoder backends.
32//
33// Mirrors EncoderProvider. WebRTC requires matching encoder and decoder
34// format support for successful SDP negotiation.
35//
36// Priority: 0 = software fallback, 100+ = hardware acceleration.
38 public:
39 virtual ~DecoderProvider() = default;
40
41 virtual std::string GetName() const = 0;
42 virtual int GetPriority() const = 0;
43 virtual bool IsAvailable() const = 0;
44 virtual std::vector<webrtc::SdpVideoFormat> GetSupportedFormats() const = 0;
46 const webrtc::SdpVideoFormat& format) const = 0;
47
48 // Descending: higher priority sorts first.
49 bool operator<(const DecoderProvider& other) const {
50 return other.GetPriority() < GetPriority();
51 }
52};
53
54} // namespace webrtc_streaming
55} // namespace cuttlefish
Definition: decoder_provider.h:37
bool operator<(const DecoderProvider &other) const
Definition: decoder_provider.h:49
virtual std::vector< webrtc::SdpVideoFormat > GetSupportedFormats() const =0
virtual Result< std::unique_ptr< webrtc::VideoDecoder > > CreateDecoder(const webrtc::SdpVideoFormat &format) const =0
virtual std::string GetName() const =0
EventFormat format
Definition: kernel_log_server.cc:60
Definition: alloc_driver.h:20
tl::expected< T, StackTraceError > Result
Definition: result_type.h:30