Fixed more coding style violations.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38446 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -128,19 +128,19 @@ MixerCore::SetOutputAttenuation(float gain)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
MixerInput *
|
MixerInput*
|
||||||
MixerCore::AddInput(const media_input &input)
|
MixerCore::AddInput(const media_input& input)
|
||||||
{
|
{
|
||||||
ASSERT_LOCKED();
|
ASSERT_LOCKED();
|
||||||
MixerInput *in = new MixerInput(this, input, fMixBufferFrameRate,
|
MixerInput* in = new MixerInput(this, input, fMixBufferFrameRate,
|
||||||
fMixBufferFrameCount);
|
fMixBufferFrameCount);
|
||||||
fInputs->AddItem(in);
|
fInputs->AddItem(in);
|
||||||
return in;
|
return in;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
MixerOutput *
|
MixerOutput*
|
||||||
MixerCore::AddOutput(const media_output &output)
|
MixerCore::AddOutput(const media_output& output)
|
||||||
{
|
{
|
||||||
ASSERT_LOCKED();
|
ASSERT_LOCKED();
|
||||||
if (fOutput) {
|
if (fOutput) {
|
||||||
@@ -410,7 +410,7 @@ MixerCore::StartMixThread()
|
|||||||
ASSERT(fOutput);
|
ASSERT(fOutput);
|
||||||
fRunning = true;
|
fRunning = true;
|
||||||
fMixThreadWaitSem = create_sem(0, "mix thread wait");
|
fMixThreadWaitSem = create_sem(0, "mix thread wait");
|
||||||
fMixThread = spawn_thread(_mix_thread_, "Yeah baby, very shagadelic", 120,
|
fMixThread = spawn_thread(MixThreadEntry, "Yeah baby, very shagadelic", 120,
|
||||||
this);
|
this);
|
||||||
resume_thread(fMixThread);
|
resume_thread(fMixThread);
|
||||||
}
|
}
|
||||||
@@ -434,9 +434,9 @@ MixerCore::StopMixThread()
|
|||||||
|
|
||||||
|
|
||||||
int32
|
int32
|
||||||
MixerCore::_mix_thread_(void *arg)
|
MixerCore::MixThreadEntry(void* arg)
|
||||||
{
|
{
|
||||||
static_cast<MixerCore *>(arg)->MixThread();
|
static_cast<MixerCore*>(arg)->MixThread();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -444,20 +444,12 @@ MixerCore::_mix_thread_(void *arg)
|
|||||||
void
|
void
|
||||||
MixerCore::MixThread()
|
MixerCore::MixThread()
|
||||||
{
|
{
|
||||||
bigtime_t event_time;
|
|
||||||
bigtime_t time_base;
|
|
||||||
bigtime_t latency;
|
|
||||||
bigtime_t start;
|
|
||||||
bigtime_t buffer_request_timeout;
|
|
||||||
int64 frame_base;
|
|
||||||
int64 frame_pos;
|
|
||||||
|
|
||||||
// The broken BeOS R5 multiaudio node starts with time 0,
|
// The broken BeOS R5 multiaudio node starts with time 0,
|
||||||
// then publishes negative times for about 50ms, publishes 0
|
// then publishes negative times for about 50ms, publishes 0
|
||||||
// again until it finally reaches time values > 0
|
// again until it finally reaches time values > 0
|
||||||
if (!LockFromMixThread())
|
if (!LockFromMixThread())
|
||||||
return;
|
return;
|
||||||
start = fTimeSource->Now();
|
bigtime_t start = fTimeSource->Now();
|
||||||
Unlock();
|
Unlock();
|
||||||
while (start <= 0) {
|
while (start <= 0) {
|
||||||
TRACE("MixerCore: delaying MixThread start, timesource is at %Ld\n",
|
TRACE("MixerCore: delaying MixThread start, timesource is at %Ld\n",
|
||||||
@@ -471,49 +463,48 @@ MixerCore::MixThread()
|
|||||||
|
|
||||||
if (!LockFromMixThread())
|
if (!LockFromMixThread())
|
||||||
return;
|
return;
|
||||||
latency = max(3600LL, bigtime_t(0.4 * buffer_duration(
|
bigtime_t latency = max(3600LL, bigtime_t(0.4 * buffer_duration(
|
||||||
fOutput->MediaOutput().format.u.raw_audio)));
|
fOutput->MediaOutput().format.u.raw_audio)));
|
||||||
|
|
||||||
// TODO: when the format changes while running, everything is wrong!
|
// TODO: when the format changes while running, everything is wrong!
|
||||||
buffer_request_timeout = buffer_duration(
|
bigtime_t bufferRequestTimeout = buffer_duration(
|
||||||
fOutput->MediaOutput().format.u.raw_audio) / 2;
|
fOutput->MediaOutput().format.u.raw_audio) / 2;
|
||||||
|
|
||||||
TRACE("MixerCore: starting MixThread at %Ld with latency %Ld and "
|
TRACE("MixerCore: starting MixThread at %Ld with latency %Ld and "
|
||||||
"downstream latency %Ld, buffer_request_timeout %Ld\n", start, latency,
|
"downstream latency %Ld, bufferRequestTimeout %Ld\n", start, latency,
|
||||||
fDownstreamLatency, buffer_request_timeout);
|
fDownstreamLatency, bufferRequestTimeout);
|
||||||
|
|
||||||
// We must read from the input buffer at a position (pos) that is always
|
// We must read from the input buffer at a position (pos) that is always
|
||||||
// a multiple of fMixBufferFrameCount.
|
// a multiple of fMixBufferFrameCount.
|
||||||
int64 temp = frames_for_duration(fMixBufferFrameRate, start);
|
int64 temp = frames_for_duration(fMixBufferFrameRate, start);
|
||||||
frame_base = ((temp / fMixBufferFrameCount) + 1) * fMixBufferFrameCount;
|
int64 frameBase = ((temp / fMixBufferFrameCount) + 1)
|
||||||
time_base = duration_for_frames(fMixBufferFrameRate, frame_base);
|
* fMixBufferFrameCount;
|
||||||
|
bigtime_t timeBase = duration_for_frames(fMixBufferFrameRate, frameBase);
|
||||||
Unlock();
|
Unlock();
|
||||||
|
|
||||||
TRACE("MixerCore: starting MixThread, start %Ld, time_base %Ld, "
|
TRACE("MixerCore: starting MixThread, start %Ld, timeBase %Ld, "
|
||||||
"frame_base %Ld\n", start, time_base, frame_base);
|
"frameBase %Ld\n", start, timeBase, frameBase);
|
||||||
|
|
||||||
ASSERT(fMixBufferFrameCount > 0);
|
ASSERT(fMixBufferFrameCount > 0);
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
uint64 buffer_num = 0;
|
uint64 bufferIndex = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
RtList<chan_info> InputChanInfos[MAX_CHANNEL_TYPES];
|
RtList<chan_info> InputChanInfos[MAX_CHANNEL_TYPES];
|
||||||
RtList<chan_info> MixChanInfos[fMixBufferChannelCount];
|
RtList<chan_info> MixChanInfos[fMixBufferChannelCount];
|
||||||
// TODO: this does not support changing output channel count
|
// TODO: this does not support changing output channel count
|
||||||
|
|
||||||
event_time = time_base;
|
bigtime_t eventTime = timeBase;
|
||||||
frame_pos = 0;
|
int64 framePos = 0;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
bigtime_t wait_until;
|
|
||||||
if (!LockFromMixThread())
|
if (!LockFromMixThread())
|
||||||
return;
|
return;
|
||||||
wait_until = fTimeSource->RealTimeFor(event_time, 0)
|
bigtime_t waitUntil = fTimeSource->RealTimeFor(eventTime, 0)
|
||||||
- latency - fDownstreamLatency;
|
- latency - fDownstreamLatency;
|
||||||
Unlock();
|
Unlock();
|
||||||
status_t rv;
|
status_t rv = acquire_sem_etc(fMixThreadWaitSem, 1, B_ABSOLUTE_TIMEOUT,
|
||||||
rv = acquire_sem_etc(fMixThreadWaitSem, 1, B_ABSOLUTE_TIMEOUT,
|
waitUntil);
|
||||||
wait_until);
|
|
||||||
if (rv == B_INTERRUPTED)
|
if (rv == B_INTERRUPTED)
|
||||||
continue;
|
continue;
|
||||||
if (rv != B_TIMED_OUT && rv < B_OK)
|
if (rv != B_TIMED_OUT && rv < B_OK)
|
||||||
@@ -528,29 +519,29 @@ MixerCore::MixThread()
|
|||||||
// empty buffer
|
// empty buffer
|
||||||
if (fInputs->IsEmpty() || fOutput->IsMuted()) {
|
if (fInputs->IsEmpty() || fOutput->IsMuted()) {
|
||||||
int size = fOutput->MediaOutput().format.u.raw_audio.buffer_size;
|
int size = fOutput->MediaOutput().format.u.raw_audio.buffer_size;
|
||||||
BBuffer* buf = fBufferGroup->RequestBuffer(size,
|
BBuffer* buffer = fBufferGroup->RequestBuffer(size,
|
||||||
buffer_request_timeout);
|
bufferRequestTimeout);
|
||||||
if (buf) {
|
if (buffer != NULL) {
|
||||||
memset(buf->Data(), 0, size);
|
memset(buffer->Data(), 0, size);
|
||||||
// fill in the buffer header
|
// fill in the buffer header
|
||||||
media_header* hdr = buf->Header();
|
media_header* hdr = buffer->Header();
|
||||||
hdr->type = B_MEDIA_RAW_AUDIO;
|
hdr->type = B_MEDIA_RAW_AUDIO;
|
||||||
hdr->size_used = size;
|
hdr->size_used = size;
|
||||||
hdr->time_source = fTimeSource->ID();
|
hdr->time_source = fTimeSource->ID();
|
||||||
hdr->start_time = event_time;
|
hdr->start_time = eventTime;
|
||||||
if (fNode->SendBuffer(buf, fOutput) != B_OK) {
|
if (fNode->SendBuffer(buffer, fOutput) != B_OK) {
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
ERROR("MixerCore: SendBuffer failed for buffer %Ld\n",
|
ERROR("MixerCore: SendBuffer failed for buffer %Ld\n",
|
||||||
buffer_num);
|
bufferIndex);
|
||||||
#else
|
#else
|
||||||
ERROR("MixerCore: SendBuffer failed\n");
|
ERROR("MixerCore: SendBuffer failed\n");
|
||||||
#endif
|
#endif
|
||||||
buf->Recycle();
|
buffer->Recycle();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
ERROR("MixerCore: RequestBuffer failed for buffer %Ld\n",
|
ERROR("MixerCore: RequestBuffer failed for buffer %Ld\n",
|
||||||
buffer_num);
|
bufferIndex);
|
||||||
#else
|
#else
|
||||||
ERROR("MixerCore: RequestBuffer failed\n");
|
ERROR("MixerCore: RequestBuffer failed\n");
|
||||||
#endif
|
#endif
|
||||||
@@ -558,96 +549,97 @@ MixerCore::MixThread()
|
|||||||
goto schedule_next_event;
|
goto schedule_next_event;
|
||||||
}
|
}
|
||||||
|
|
||||||
int64 cur_framepos;
|
int64 currentFramePos;
|
||||||
cur_framepos = frame_base + frame_pos;
|
currentFramePos = frameBase + framePos;
|
||||||
|
|
||||||
// mix all data from all inputs into the mix buffer
|
// mix all data from all inputs into the mix buffer
|
||||||
ASSERT(cur_framepos % fMixBufferFrameCount == 0);
|
ASSERT(currentFramePos % fMixBufferFrameCount == 0);
|
||||||
|
|
||||||
PRINT(4, "create new buffer event at %Ld, reading input frames at "
|
PRINT(4, "create new buffer event at %Ld, reading input frames at "
|
||||||
"%Ld\n", event_time, cur_framepos);
|
"%Ld\n", eventTime, currentFramePos);
|
||||||
|
|
||||||
MixerInput *input;
|
for (int i = 0; MixerInput* input = Input(i); i++) {
|
||||||
for (int i = 0; (input = Input(i)) != 0; i++) {
|
|
||||||
int count = input->GetMixerChannelCount();
|
int count = input->GetMixerChannelCount();
|
||||||
for (int chan = 0; chan < count; chan++) {
|
for (int channel = 0; channel < count; channel++) {
|
||||||
int type;
|
int type;
|
||||||
const float *base;
|
const float* base;
|
||||||
uint32 sample_offset;
|
uint32 sampleOffset;
|
||||||
float gain;
|
float gain;
|
||||||
if (!input->GetMixerChannelInfo(chan, cur_framepos, event_time,
|
if (!input->GetMixerChannelInfo(channel, currentFramePos,
|
||||||
&base, &sample_offset, &type, &gain))
|
eventTime, &base, &sampleOffset, &type, &gain)) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
if (type < 0 || type >= MAX_CHANNEL_TYPES)
|
if (type < 0 || type >= MAX_CHANNEL_TYPES)
|
||||||
continue;
|
continue;
|
||||||
chan_info *info = InputChanInfos[type].Create();
|
chan_info* info = InputChanInfos[type].Create();
|
||||||
info->base = (const char *)base;
|
info->base = (const char*)base;
|
||||||
info->sample_offset = sample_offset;
|
info->sample_offset = sampleOffset;
|
||||||
info->gain = gain;
|
info->gain = gain;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int chan = 0; chan < fMixBufferChannelCount; chan++) {
|
for (int channel = 0; channel < fMixBufferChannelCount; channel++) {
|
||||||
int sourcecount = fOutput->GetOutputChannelSourceCount(chan);
|
int sourceCount = fOutput->GetOutputChannelSourceCount(channel);
|
||||||
for (int i = 0; i < sourcecount; i++) {
|
for (int i = 0; i < sourceCount; i++) {
|
||||||
int type;
|
int type;
|
||||||
float gain;
|
float gain;
|
||||||
fOutput->GetOutputChannelSourceInfoAt(chan, i, &type, &gain);
|
fOutput->GetOutputChannelSourceInfoAt(channel, i, &type,
|
||||||
|
&gain);
|
||||||
if (type < 0 || type >= MAX_CHANNEL_TYPES)
|
if (type < 0 || type >= MAX_CHANNEL_TYPES)
|
||||||
continue;
|
continue;
|
||||||
int count = InputChanInfos[type].CountItems();
|
int count = InputChanInfos[type].CountItems();
|
||||||
for (int j = 0; j < count; j++) {
|
for (int j = 0; j < count; j++) {
|
||||||
chan_info *info = InputChanInfos[type].ItemAt(j);
|
chan_info* info = InputChanInfos[type].ItemAt(j);
|
||||||
chan_info *newinfo = MixChanInfos[chan].Create();
|
chan_info* newInfo = MixChanInfos[channel].Create();
|
||||||
newinfo->base = info->base;
|
newInfo->base = info->base;
|
||||||
newinfo->sample_offset = info->sample_offset;
|
newInfo->sample_offset = info->sample_offset;
|
||||||
newinfo->gain = info->gain * gain;
|
newInfo->gain = info->gain * gain;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(fMixBuffer, 0,
|
memset(fMixBuffer, 0,
|
||||||
fMixBufferChannelCount * fMixBufferFrameCount * sizeof(float));
|
fMixBufferChannelCount * fMixBufferFrameCount * sizeof(float));
|
||||||
for (int chan = 0; chan < fMixBufferChannelCount; chan++) {
|
for (int channel = 0; channel < fMixBufferChannelCount; channel++) {
|
||||||
PRINT(5, "MixThread: chan %d has %d sources\n", chan,
|
PRINT(5, "MixThread: channel %d has %d sources\n", channel,
|
||||||
MixChanInfos[chan].CountItems());
|
MixChanInfos[channel].CountItems());
|
||||||
|
|
||||||
int count = MixChanInfos[chan].CountItems();
|
int count = MixChanInfos[channel].CountItems();
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
chan_info *info = MixChanInfos[chan].ItemAt(i);
|
chan_info* info = MixChanInfos[channel].ItemAt(i);
|
||||||
PRINT(5, "MixThread: base %p, sample-offset %2d, gain %.3f\n",
|
PRINT(5, "MixThread: base %p, sample-offset %2d, gain %.3f\n",
|
||||||
info->base, info->sample_offset, info->gain);
|
info->base, info->sample_offset, info->gain);
|
||||||
// This looks slightly ugly, but the current GCC will generate
|
// This looks slightly ugly, but the current GCC will generate
|
||||||
// the fastest code this way.
|
// the fastest code this way.
|
||||||
// fMixBufferFrameCount is always > 0.
|
// fMixBufferFrameCount is always > 0.
|
||||||
uint32 dst_sample_offset
|
uint32 dstSampleOffset
|
||||||
= fMixBufferChannelCount * sizeof(float);
|
= fMixBufferChannelCount * sizeof(float);
|
||||||
uint32 src_sample_offset = info->sample_offset;
|
uint32 srcSampleOffset = info->sample_offset;
|
||||||
register char *dst = (char *)&fMixBuffer[chan];
|
register char* dst = (char*)&fMixBuffer[channel];
|
||||||
register char *src = (char *)info->base;
|
register char* src = (char*)info->base;
|
||||||
register float gain = info->gain;
|
register float gain = info->gain;
|
||||||
register int j = fMixBufferFrameCount;
|
register int j = fMixBufferFrameCount;
|
||||||
do {
|
do {
|
||||||
*(float *)dst += *(const float *)src * gain;
|
*(float*)dst += *(const float*)src * gain;
|
||||||
dst += dst_sample_offset;
|
dst += dstSampleOffset;
|
||||||
src += src_sample_offset;
|
src += srcSampleOffset;
|
||||||
} while (--j);
|
} while (--j);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// request a buffer
|
// request a buffer
|
||||||
BBuffer *buf;
|
BBuffer* buffer;
|
||||||
buf = fBufferGroup->RequestBuffer(
|
buffer = fBufferGroup->RequestBuffer(
|
||||||
fOutput->MediaOutput().format.u.raw_audio.buffer_size,
|
fOutput->MediaOutput().format.u.raw_audio.buffer_size,
|
||||||
buffer_request_timeout);
|
bufferRequestTimeout);
|
||||||
if (buf) {
|
if (buffer != NULL) {
|
||||||
// copy data from mix buffer into output buffer
|
// copy data from mix buffer into output buffer
|
||||||
for (int i = 0; i < fMixBufferChannelCount; i++) {
|
for (int i = 0; i < fMixBufferChannelCount; i++) {
|
||||||
fResampler[i]->Resample(
|
fResampler[i]->Resample(
|
||||||
reinterpret_cast<char *>(fMixBuffer) + i * sizeof(float),
|
reinterpret_cast<char*>(fMixBuffer) + i * sizeof(float),
|
||||||
fMixBufferChannelCount * sizeof(float),
|
fMixBufferChannelCount * sizeof(float),
|
||||||
fMixBufferFrameCount,
|
fMixBufferFrameCount,
|
||||||
reinterpret_cast<char *>(buf->Data())
|
reinterpret_cast<char*>(buffer->Data())
|
||||||
+ (i * bytes_per_sample(
|
+ (i * bytes_per_sample(
|
||||||
fOutput->MediaOutput().format.u.raw_audio)),
|
fOutput->MediaOutput().format.u.raw_audio)),
|
||||||
bytes_per_frame(fOutput->MediaOutput().format.u.raw_audio),
|
bytes_per_frame(fOutput->MediaOutput().format.u.raw_audio),
|
||||||
@@ -660,31 +652,31 @@ MixerCore::MixThread()
|
|||||||
frames_per_buffer(fOutput->MediaOutput().format.u.raw_audio));
|
frames_per_buffer(fOutput->MediaOutput().format.u.raw_audio));
|
||||||
|
|
||||||
// fill in the buffer header
|
// fill in the buffer header
|
||||||
media_header* hdr = buf->Header();
|
media_header* hdr = buffer->Header();
|
||||||
hdr->type = B_MEDIA_RAW_AUDIO;
|
hdr->type = B_MEDIA_RAW_AUDIO;
|
||||||
hdr->size_used
|
hdr->size_used
|
||||||
= fOutput->MediaOutput().format.u.raw_audio.buffer_size;
|
= fOutput->MediaOutput().format.u.raw_audio.buffer_size;
|
||||||
hdr->time_source = fTimeSource->ID();
|
hdr->time_source = fTimeSource->ID();
|
||||||
hdr->start_time = event_time;
|
hdr->start_time = eventTime;
|
||||||
|
|
||||||
// swap byte order if necessary
|
// swap byte order if necessary
|
||||||
fOutput->AdjustByteOrder(buf);
|
fOutput->AdjustByteOrder(buffer);
|
||||||
|
|
||||||
// send the buffer
|
// send the buffer
|
||||||
status_t res = fNode->SendBuffer(buf, fOutput);
|
status_t res = fNode->SendBuffer(buffer, fOutput);
|
||||||
if (res != B_OK) {
|
if (res != B_OK) {
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
ERROR("MixerCore: SendBuffer failed for buffer %Ld\n",
|
ERROR("MixerCore: SendBuffer failed for buffer %Ld\n",
|
||||||
buffer_num);
|
bufferIndex);
|
||||||
#else
|
#else
|
||||||
ERROR("MixerCore: SendBuffer failed\n");
|
ERROR("MixerCore: SendBuffer failed\n");
|
||||||
#endif
|
#endif
|
||||||
buf->Recycle();
|
buffer->Recycle();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
ERROR("MixerCore: RequestBuffer failed for buffer %Ld\n",
|
ERROR("MixerCore: RequestBuffer failed for buffer %Ld\n",
|
||||||
buffer_num);
|
bufferIndex);
|
||||||
#else
|
#else
|
||||||
ERROR("MixerCore: RequestBuffer failed\n");
|
ERROR("MixerCore: RequestBuffer failed\n");
|
||||||
#endif
|
#endif
|
||||||
@@ -698,12 +690,12 @@ MixerCore::MixThread()
|
|||||||
|
|
||||||
schedule_next_event:
|
schedule_next_event:
|
||||||
// schedule next event
|
// schedule next event
|
||||||
frame_pos += fMixBufferFrameCount;
|
framePos += fMixBufferFrameCount;
|
||||||
event_time = time_base + bigtime_t((1000000LL * frame_pos)
|
eventTime = timeBase + bigtime_t((1000000LL * framePos)
|
||||||
/ fMixBufferFrameRate);
|
/ fMixBufferFrameRate);
|
||||||
Unlock();
|
Unlock();
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
buffer_num++;
|
bufferIndex++;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ public:
|
|||||||
|
|
||||||
void SetOutputBufferGroup(BBufferGroup* group);
|
void SetOutputBufferGroup(BBufferGroup* group);
|
||||||
void SetTimingInfo(BTimeSource* timeSource,
|
void SetTimingInfo(BTimeSource* timeSource,
|
||||||
bigtime_t downstream_latency);
|
bigtime_t downstreamLatency);
|
||||||
void EnableOutput(bool enabled);
|
void EnableOutput(bool enabled);
|
||||||
bool Start();
|
bool Start();
|
||||||
bool Stop();
|
bool Stop();
|
||||||
@@ -78,7 +78,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void ApplyOutputFormat();
|
void ApplyOutputFormat();
|
||||||
static int32 _mix_thread_(void* arg);
|
static int32 MixThreadEntry(void* arg);
|
||||||
void MixThread();
|
void MixThread();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -75,9 +75,10 @@ MixerInput::MixerInput(MixerCore *core, const media_input &input,
|
|||||||
|
|
||||||
// create resamplers
|
// create resamplers
|
||||||
fResampler = new Resampler * [fInputChannelCount];
|
fResampler = new Resampler * [fInputChannelCount];
|
||||||
for (int i = 0; i < fInputChannelCount; i++)
|
for (int i = 0; i < fInputChannelCount; i++) {
|
||||||
// TODO create Interpolate instead of Resampler if the settings says so
|
// TODO create Interpolate instead of Resampler if the settings says so
|
||||||
fResampler[i] = new Resampler(fInput.format.u.raw_audio.format, media_raw_audio_format::B_AUDIO_FLOAT);
|
fResampler[i] = new Resampler(fInput.format.u.raw_audio.format, media_raw_audio_format::B_AUDIO_FLOAT);
|
||||||
|
}
|
||||||
|
|
||||||
// fMixerChannelInfo and fMixerChannelCount will be initialized by UpdateInputChannelDestinations()
|
// fMixerChannelInfo and fMixerChannelCount will be initialized by UpdateInputChannelDestinations()
|
||||||
SetMixBufferFormat((int32)mixFrameRate, mixFrameCount);
|
SetMixBufferFormat((int32)mixFrameRate, mixFrameCount);
|
||||||
|
|||||||
Reference in New Issue
Block a user