*/
+#include "compose.hpp"
+#include "cross.h"
#include "ffmpeg_encoder.h"
#include "ffmpeg_wrapper.h"
#include "film.h"
+#include "image.h"
#include "job.h"
+#include "log.h"
#include "player.h"
#include "player_video.h"
-#include "log.h"
-#include "image.h"
-#include "cross.h"
-#include "compose.hpp"
+extern "C" {
+#include <libavutil/channel_layout.h>
+}
#include <iostream>
#include "i18n.h"
using std::cout;
using std::make_shared;
-using std::pair;
-using std::runtime_error;
using std::shared_ptr;
using std::string;
-using std::weak_ptr;
using boost::bind;
-using boost::optional;
using namespace dcpomatic;
#if BOOST_VERSION >= 106100
using namespace boost::placeholders;
auto frame = av_frame_alloc ();
DCPOMATIC_ASSERT (frame);
- int const buffer_size = av_samples_get_buffer_size (0, channels, size, _codec_context->sample_fmt, 0);
+ int line_size;
+ int const buffer_size = av_samples_get_buffer_size (&line_size, channels, size, _codec_context->sample_fmt, 0);
DCPOMATIC_ASSERT (buffer_size >= 0);
auto samples = av_malloc (buffer_size);
}
case AV_SAMPLE_FMT_FLTP:
{
- float* q = reinterpret_cast<float*> (samples);
for (int i = 0; i < channels; ++i) {
- memcpy (q, data[i + channel_offset], sizeof(float) * size);
- q += size;
+ memcpy (reinterpret_cast<float*>(static_cast<uint8_t*>(samples) + i * line_size), data[i + channel_offset], sizeof(float) * size);
}
break;
}
private:
AVFormatContext* _format_context;
- AVCodec* _codec;
+ AVCodec const * _codec;
AVCodecContext* _codec_context;
AVStream* _stream;
int _stream_index;
auto image = video->image (
bind (&PlayerVideo::force, _1, _pixel_format),
VideoRange::VIDEO,
- true,
false
);
}
for (int i = 0; i < 3; ++i) {
- AVBufferRef* buffer = av_buffer_create(image->data()[i], image->stride()[i] * image->size().height, &buffer_free, this, 0);
+ auto buffer = av_buffer_create(image->data()[i], image->stride()[i] * image->size().height, &buffer_free, this, 0);
frame->buf[i] = av_buffer_ref (buffer);
frame->data[i] = buffer->data;
frame->linesize[i] = image->stride()[i];