Commit 6f921a25 authored by Tristan Matthews's avatar Tristan Matthews

video: whitespace fixes

parent 0cd2064a
......@@ -43,14 +43,13 @@ extern "C" {
#include <libavdevice/avdevice.h>
}
namespace {
static std::map<std::string, std::string> encoders;
static std::vector<std::string> video_codecs;
/* application wide mutex to protect concurrent access to avcodec */
static ost::Mutex avcodec_lock;
namespace {
void findInstalledVideoCodecs()
{
......@@ -77,23 +76,22 @@ namespace libav_utils {
std::vector<std::string> getVideoCodecList()
{
return video_codecs;
return video_codecs;
}
static int avcodecManageMutex(void **mutex, enum AVLockOp op)
static int avcodecManageMutex(void ** /*mutex*/, enum AVLockOp op)
{
(void)mutex; // no need to store our mutex in ffmpeg
switch(op) {
case AV_LOCK_CREATE:
break; // our mutex is already created
case AV_LOCK_DESTROY:
break; // our mutex doesn't need to be destroyed
case AV_LOCK_OBTAIN:
avcodec_lock.enter();
break;
case AV_LOCK_RELEASE:
avcodec_lock.leave();
break;
case AV_LOCK_CREATE:
break; // our mutex is already created
case AV_LOCK_DESTROY:
break; // our mutex doesn't need to be destroyed
case AV_LOCK_OBTAIN:
avcodec_lock.enter();
break;
case AV_LOCK_RELEASE:
avcodec_lock.leave();
break;
}
return 0;
......@@ -101,7 +99,7 @@ static int avcodecManageMutex(void **mutex, enum AVLockOp op)
std::map<std::string, std::string> encodersMap()
{
return encoders;
return encoders;
}
void sfl_avcodec_init()
......@@ -119,19 +117,18 @@ void sfl_avcodec_init()
av_lockmgr_register(avcodecManageMutex);
/* list of codecs tested and confirmed to work */
encoders["H264"] = "libx264";
encoders["H263-2000"] = "h263p";
encoders["VP8"] = "libvpx";
encoders["MP4V-ES"] = "mpeg4";
encoders["H264"] = "libx264";
encoders["H263-2000"] = "h263p";
encoders["VP8"] = "libvpx";
encoders["MP4V-ES"] = "mpeg4";
//FFmpeg needs to be modified to allow us to send configuration
//inline, with CODEC_FLAG_GLOBAL_HEADER
//encoders["THEORA"] = "libtheora";
//encoders["THEORA"] = "libtheora";
// ffmpeg hardcodes RTP output format to H263-2000
// but it can receive H263-1998
//encoders["H263-1998"] = "h263p";
// encoders["H263-1998"] = "h263p";
// ffmpeg doesn't know RTP format for H263 (payload type = 34)
//encoders["H263"] = "h263";
......
......@@ -63,7 +63,7 @@ namespace { // anonymous namespace
int getBufferSize(int width, int height, int format)
{
enum PixelFormat fmt = (enum PixelFormat) format;
enum PixelFormat fmt = (enum PixelFormat) format;
// determine required buffer size and allocate buffer
return sizeof(uint8_t) * avpicture_get_size(fmt, width, height);
}
......
......@@ -97,10 +97,10 @@ void VideoRtpSession::updateSDP(const Sdp &sdp)
const string codec = libav_utils::encodersMap()[v[1]];
if (codec.empty()) {
DEBUG("Couldn't find encoder for \"%s\"\n", v[1].c_str());
sending_ = false;
DEBUG("Couldn't find encoder for \"%s\"\n", v[1].c_str());
sending_ = false;
} else {
txArgs_["codec"] = codec;
txArgs_["codec"] = codec;
}
txArgs_["payload_type"] = v[2];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment