channels/rdpsnd: added better format debug output

This commit is contained in:
Marc-André Moreau 2013-02-27 20:46:14 -05:00
parent af80955b78
commit 5468c53720
2 changed files with 54 additions and 3 deletions

View File

@ -172,6 +172,21 @@ char* rdpsnd_get_audio_tag_string(UINT16 wFormatTag)
case WAVE_FORMAT_DVI_ADPCM:
return "WAVE_FORMAT_DVI_ADPCM";
case WAVE_FORMAT_GSM610:
return "WAVE_FORMAT_GSM610";
case WAVE_FORMAT_MSG723:
return "WAVE_FORMAT_MSG723";
case WAVE_FORMAT_DSPGROUP_TRUESPEECH:
return "WAVE_FORMAT_DSPGROUP_TRUESPEECH ";
case WAVE_FORMAT_MPEGLAYER3:
return "WAVE_FORMAT_MPEGLAYER3";
case WAVE_FORMAT_WMAUDIO2:
return "WAVE_FORMAT_WMAUDIO2";
}
return "WAVE_FORMAT_UNKNOWN";
@ -179,10 +194,31 @@ char* rdpsnd_get_audio_tag_string(UINT16 wFormatTag)
void rdpsnd_print_audio_format(AUDIO_FORMAT* format)
{
printf("%s: wFormatTag: 0x%04X nChannels: %d nSamplesPerSec: %d nAvgBytesPerSec: %d nBlockAlign: %d wBitsPerSample: %d\n",
printf("%s:\t wFormatTag: 0x%04X nChannels: %d nSamplesPerSec: %d nAvgBytesPerSec: %d nBlockAlign: %d wBitsPerSample: %d cbSize: %d\n",
rdpsnd_get_audio_tag_string(format->wFormatTag), format->wFormatTag,
format->nChannels, format->nSamplesPerSec, format->nAvgBytesPerSec,
format->nBlockAlign, format->wBitsPerSample);
format->nBlockAlign, format->wBitsPerSample, format->cbSize);
}
void rdpsnd_print_audio_formats(AUDIO_FORMAT* formats, UINT16 count)
{
int index;
AUDIO_FORMAT* format;
if (formats)
{
printf("AUDIO_FORMATS (%d) =\n{\n", count);
for (index = 0; index < (int) count; index++)
{
format = &formats[index];
printf("\t");
rdpsnd_print_audio_format(format);
}
printf("}\n");
}
}
UINT32 rdpsnd_compute_audio_time_length(AUDIO_FORMAT* format, int size)
@ -241,6 +277,16 @@ void rdpsnd_select_supported_audio_formats(rdpsndPlugin* rdpsnd)
}
}
}
#if 0
printf("Server ");
rdpsnd_print_audio_formats(rdpsnd->ServerFormats, rdpsnd->NumberOfServerFormats);
printf("\n");
printf("Client ");
rdpsnd_print_audio_formats(rdpsnd->ClientFormats, rdpsnd->NumberOfClientFormats);
printf("\n");
#endif
}
void rdpsnd_send_client_audio_formats(rdpsndPlugin* rdpsnd)
@ -400,6 +446,8 @@ static void rdpsnd_recv_wave_info_pdu(rdpsndPlugin* rdpsnd, STREAM* s, UINT16 Bo
rdpsnd->isOpen = TRUE;
rdpsnd->wCurrentFormatNo = wFormatNo;
//rdpsnd_print_audio_format(format);
if (rdpsnd->device)
{
IFCALL(rdpsnd->device->Open, rdpsnd->device, format, rdpsnd->latency);

View File

@ -120,7 +120,7 @@ typedef struct AUDIO_FORMAT AUDIO_FORMAT;
#define WAVE_FORMAT_PAC 0x0053
#ifndef WAVE_FORMAT_MPEGLAYER3
#define WAVE_FORMAT_MPEGLAYER3 0x0054
#define WAVE_FORMAT_MPEGLAYER3 0x0055
#endif
#define WAVE_FORMAT_LUCENT_G723 0x0059
@ -162,6 +162,9 @@ typedef struct AUDIO_FORMAT AUDIO_FORMAT;
#define WAVE_FORMAT_VIVO_G723 0x0111
#define WAVE_FORMAT_VIVO_SIREN 0x0112
#define WAVE_FORMAT_DIGITAL_G723 0x0123
#define WAVE_FORMAT_WMAUDIO2 0x0161
#define WAVE_FORMAT_WMAUDIO3 0x0162
#define WAVE_FORMAT_WMAUDIO_LOSSLESS 0x0163
#define WAVE_FORMAT_CREATIVE_ADPCM 0x0200
#define WAVE_FORMAT_CREATIVE_FASTSPEECH8 0x0202
#define WAVE_FORMAT_CREATIVE_FASTSPEECH10 0x0203