some uncommited changes from long time ago. hope this doesn't break anything.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7448 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
beveloper
2004-05-07 18:43:44 +00:00
parent 28f08e9eb3
commit 666fb348c4
4 changed files with 15 additions and 13 deletions
@@ -1,4 +1,5 @@
SubDir OBOS_TOP src add-ons kernel drivers audio ac97 ;
SubInclude OBOS_TOP src add-ons kernel drivers audio ac97 auvia ;
SubInclude OBOS_TOP src add-ons kernel drivers audio ac97 ich ;
SubInclude OBOS_TOP src add-ons kernel drivers audio ac97 auvia ;
SubInclude OBOS_TOP src add-ons kernel drivers audio ac97 ichaudio ;
@@ -3,7 +3,7 @@
#include "io.h"
status_t ichaudio_attach(audio_drv_t *drv, void **cookie);
status_t ichaudio_powerctl(audio_drv_t *drv, void *cookie);
status_t ichaudio_powerctl(audio_drv_t *drv, void *cookie, int op);
status_t ichaudio_detach(audio_drv_t *drv, void *cookie);
status_t ichaudio_stream_attach(audio_drv_t *drv, void *cookie, int stream_id);
status_t ichaudio_stream_detach(audio_drv_t *drv, void *cookie, int stream_id);
@@ -292,11 +292,9 @@ ichaudio_detach(audio_drv_t *drv, void *_cookie)
status_t
ichaudio_powerctl(audio_drv_t *drv, void *_cookie)
ichaudio_powerctl(audio_drv_t *drv, void *_cookie, int op)
{
ichaudio_cookie *cookie = (ichaudio_cookie *)_cookie;
return B_OK;
return B_ERROR;
}
void
@@ -37,7 +37,7 @@ typedef int32 control_id;
typedef status_t (*drv_attach) (audio_drv_t *drv, void **cookie);
typedef status_t (*drv_powerctl) (audio_drv_t *drv, void *cookie);
typedef status_t (*drv_powerctl) (audio_drv_t *drv, void *cookie, int op);
typedef status_t (*drv_detach) (audio_drv_t *drv, void *cookie);
@@ -8,12 +8,15 @@
#include "RawFormats.h"
#include "avi_reader.h"
#if 0
//#define TRACE_AVI_READER
#ifdef TRACE_AVI_READER
#define TRACE printf
#else
#define TRACE(a...)
#endif
#define ERROR(a...) fprintf(stderr, a)
// http://web.archive.org/web/20030618161228/http://www.microsoft.com/Developer/PRODINFO/directx/dxm/help/ds/FiltDev/DV_Data_AVI_File_Format.htm
// http://mediaxw.sourceforge.net/files/doc/Video%20for%20Windows%20Reference%20-%20Chapter%204%20-%20AVI%20Files.pdf
@@ -85,7 +88,7 @@ aviReader::Sniff(int32 *streamCount)
fFile = new OpenDMLFile();
if (B_OK != fFile->SetTo(pos_io_source)) {
TRACE("aviReader::Sniff: can't setup OpenDMLFile\n");
ERROR("aviReader::Sniff: can't setup OpenDMLFile\n");
return B_ERROR;
}
@@ -125,7 +128,7 @@ aviReader::AllocateCookie(int32 streamNumber, void **_cookie)
const avi_stream_header *stream_header;
stream_header = fFile->StreamFormat(cookie->stream);
if (!stream_header) {
TRACE("aviReader::GetStreamInfo: stream %d has no header\n", cookie->stream);
ERROR("aviReader::GetStreamInfo: stream %d has no header\n", cookie->stream);
delete cookie;
return B_ERROR;
}
@@ -135,7 +138,7 @@ aviReader::AllocateCookie(int32 streamNumber, void **_cookie)
if (fFile->IsAudio(cookie->stream)) {
const wave_format_ex *audio_format = fFile->AudioFormat(cookie->stream);
if (!audio_format) {
TRACE("aviReader::GetStreamInfo: audio stream %d has no format\n", cookie->stream);
ERROR("aviReader::GetStreamInfo: audio stream %d has no format\n", cookie->stream);
delete cookie;
return B_ERROR;
}
@@ -200,7 +203,7 @@ aviReader::AllocateCookie(int32 streamNumber, void **_cookie)
else if (audio_format->bits_per_sample <= 32)
format->u.raw_audio.format = B_AUDIO_FORMAT_INT32;
else {
TRACE("WavReader::AllocateCookie: unhandled bits per sample %d\n", audio_format->bits_per_sample);
ERROR("WavReader::AllocateCookie: unhandled bits per sample %d\n", audio_format->bits_per_sample);
return B_ERROR;
}
format->u.raw_audio.format |= B_AUDIO_FORMAT_CHANNEL_ORDER_WAVE;
@@ -236,7 +239,7 @@ aviReader::AllocateCookie(int32 streamNumber, void **_cookie)
if (fFile->IsVideo(cookie->stream)) {
const bitmap_info_header *video_format = fFile->VideoFormat(cookie->stream);
if (!video_format) {
TRACE("aviReader::GetStreamInfo: video stream %d has no format\n", cookie->stream);
ERROR("aviReader::GetStreamInfo: video stream %d has no format\n", cookie->stream);
delete cookie;
return B_ERROR;
}