Skip to content
Snippets Groups Projects
Commit 0a5e63b6 authored by Andreas Traczyk's avatar Andreas Traczyk Committed by Guillaume Roguez
Browse files

media: syntax modifications for native Windows build


- includes <functional> in media_buffer.h for std::function.

- forward declare AudioFrame and DeviceParams as structs in
  media_decoder.h, as they are both defined as such.

- remove AVRational compound literal from media_encoder.cpp.

- use a #pragma message instead of a #warning in Visual Studio

Change-Id: If32cfbb7504d65c9687814dcc3b5dfa859017fc5
Tuleap: #790
Reviewed-by: default avatarGuillaume Roguez <guillaume.roguez@savoirfairelinux.com>
parent 45f3725b
Branches
Tags
No related merge requests found
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include "config.h" #include "config.h"
#include <memory> #include <memory>
#include <functional>
class AVFrame; class AVFrame;
......
...@@ -50,12 +50,12 @@ class HardwareAccel; ...@@ -50,12 +50,12 @@ class HardwareAccel;
} }
#endif #endif
class AudioFrame; struct AudioFrame;
class AudioFormat; class AudioFormat;
class RingBuffer; class RingBuffer;
class Resampler; class Resampler;
class MediaIOHandle; class MediaIOHandle;
class DeviceParams; struct DeviceParams;
class MediaDecoder { class MediaDecoder {
public: public:
......
...@@ -594,7 +594,7 @@ void MediaEncoder::prepareEncoderContext(bool is_video) ...@@ -594,7 +594,7 @@ void MediaEncoder::prepareEncoderContext(bool is_video)
auto v = av_dict_get(options_, "sample_rate", NULL, 0); auto v = av_dict_get(options_, "sample_rate", NULL, 0);
if (v) { if (v) {
encoderCtx_->sample_rate = atoi(v->value); encoderCtx_->sample_rate = atoi(v->value);
encoderCtx_->time_base = (AVRational) {1, encoderCtx_->sample_rate}; encoderCtx_->time_base = AVRational{1, encoderCtx_->sample_rate};
} else { } else {
RING_WARN("[%s] No sample rate set", encoderName); RING_WARN("[%s] No sample rate set", encoderName);
encoderCtx_->sample_rate = 8000; encoderCtx_->sample_rate = 8000;
......
...@@ -127,7 +127,11 @@ int ff_srtp_decrypt(struct SRTPContext *s, uint8_t *buf, int *lenptr) ...@@ -127,7 +127,11 @@ int ff_srtp_decrypt(struct SRTPContext *s, uint8_t *buf, int *lenptr)
{ {
uint8_t iv[16] = { 0 }, hmac[20]; uint8_t iv[16] = { 0 }, hmac[20];
int len = *lenptr; int len = *lenptr;
#ifdef _MSC_VER
#pragma message (__FILE__ "(" STR2(__LINE__) ") : -NOTE- " seq_largest and roc may be unitialized)
#else
#warning seq_largest and roc may be unitialized #warning seq_largest and roc may be unitialized
#endif
int av_uninit(seq_largest); int av_uninit(seq_largest);
uint32_t ssrc, av_uninit(roc); uint32_t ssrc, av_uninit(roc);
uint64_t index; uint64_t index;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment