Ignition Common

API Reference

4.4.0
HWEncoder.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2020 Martin Pecka
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 #ifndef IGNITION_COMMON_HWENCODER_HH
17 #define IGNITION_COMMON_HWENCODER_HH
18 
19 #include <memory>
20 #include <string>
21 #include <optional>
22 
24 #include <ignition/common/av/Export.hh>
28 
31 namespace ignition::common
32 {
33  // Forward declare private data class
34  class HWVideoPrivate;
35 
39  class IGNITION_COMMON_AV_HIDDEN HWEncoder
40  {
52  public: HWEncoder(FlagSet<HWEncoderType> _allowedHwEncoders,
53  const std::string& _hwAccelDevice,
54  std::optional<bool> _useHwSurface);
55  public: virtual ~HWEncoder();
56 
62  public: AVCodec* FindEncoder(AVCodecID _codecId);
63 
71  public: void ConfigHWAccel(AVCodecContext* _encoderContext);
72 
79  public: AVFrame* GetFrameForEncoder(AVFrame* _inFrame);
80 
83  public: HWEncoderType GetEncoderType() const;
84 
85  private: std::unique_ptr<HWVideoPrivate> dataPtr;
86  };
87 }
88 
89 #endif
STL class.
Set of flags defined by a C++11 enum class.
Definition: FlagSet.hh:59
Representation of a GPU video encoder and its configuration.
Definition: HWEncoder.hh:39
Definition: Base64.hh:25