##

Video.hh
Go to the documentation of this file.
/*
* Copyright (C) 2012 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef _GAZEBO_COMMON_VIDEO_HH_
#define _GAZEBO_COMMON_VIDEO_HH_
#include <string>
#include "gazebo/util/system.hh"
struct AVFormatContext;
struct AVCodecContext;
struct AVFrame;
struct AVPicture;
struct SwsContext;
namespace gazebo
{
namespace common
{
class GZ_COMMON_VISIBLE Video
{
public: Video();
public: virtual ~Video();
public: bool Load(const std::string &_filename);
public: int GetWidth() const;
public: int GetHeight() const;
public: bool GetNextFrame(unsigned char **_buffer);
private: void Cleanup();
private: AVFormatContext *formatCtx;
private: AVCodecContext *codecCtx;
private: AVFrame *avFrame;
private: AVFrame *avFrameDst;
private: SwsContext *swsCtx;
private: int videoStream;
};
}
}
#endif
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
common
common
Definition: FuelModelDatabase.hh:37
system.hh
gazebo::common::Video::GetWidth
int GetWidth() const
Get the width of the video in pixels.
gazebo::common::Video::Video
Video()
Constructor.
gazebo::common::Video::GetHeight
int GetHeight() const
Get the height of the video in pixels.
gazebo::common::Video
Handle video encoding and decoding using libavcodec.
Definition: Video.hh:38
gazebo::common::Video::~Video
virtual ~Video()
Destructor.
gazebo::common::Video::GetNextFrame
bool GetNextFrame(unsigned char **_buffer)
Get the next frame of the video.
gazebo::common::Video::Load
bool Load(const std::string &_filename)
Load a video file.