Gazebo Common

API Reference

4.8.1
gz/common/Video.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 Open Source Robotics Foundation
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 #ifndef GZ_COMMON_VIDEO_HH_
18 #define GZ_COMMON_VIDEO_HH_
19 
20 #include <string>
21 #include <memory>
22 
23 #include <gz/common/config.hh>
24 #include <gz/common/av/Export.hh>
26 
27 struct AVFormatContext;
28 struct AVCodecContext;
29 struct AVFrame;
30 struct AVPicture;
31 struct SwsContext;
32 
33 namespace ignition
34 {
35  namespace common
36  {
37  // Forward declare private data class
38  class VideoPrivate;
39 
41  class IGNITION_COMMON_AV_VISIBLE Video
42  {
44  public: Video();
45 
47  public: virtual ~Video();
48 
52  public: bool Load(const std::string &_filename);
53 
56  public: int Width() const;
57 
60  public: int Height() const;
61 
64  public:
66 
69  public: Length Duration() const;
70 
75  public: bool NextFrame(unsigned char **_buffer);
76 
78  private: void Cleanup();
79 
82  private: std::unique_ptr<VideoPrivate> dataPtr;
84  };
85  }
86 }
87 #endif
Handle video encoding and decoding using libavcodec.
Definition: gz/common/Video.hh:42
virtual ~Video()
Destructor.
bool NextFrame(unsigned char **_buffer)
Get the next frame of the video.
int Height() const
Get the height of the video in pixels.
int Width() const
Get the width of the video in pixels.
Length Duration() const
Get the duration of the video.
bool Load(const std::string &_filename)
Load a video file.
#define IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING
Microsoft Visual Studio does not automatically export the interface information for member variables ...
Definition: gz/common/SuppressWarning.hh:65
#define IGN_COMMON_WARN_RESUME__DLL_INTERFACE_MISSING
Definition: gz/common/SuppressWarning.hh:68
Forward declarations for the common classes.