cl_cinematic_ogm.c File Reference

#include "cl_cinematic_ogm.h"
#include "cl_cinematic.h"
#include "../renderer/r_draw.h"
#include "../sound/s_main.h"
#include "../sound/s_music.h"
#include <ogg/ogg.h>
#include <vorbis/codec.h>
Include dependency graph for cl_cinematic_ogm.c:

Go to the source code of this file.

Data Structures

struct  yuvTable_t
struct  ogmCinematic_t

Defines

#define OGG_BUFFER_SIZE   (8 * 1024)
#define OGMCIN   (*((ogmCinematic_t*)cin->codecData))
#define OGM_CINEMATIC_BPP   4
#define SIZEOF_RAWBUFF   SAMPLE_SIZE * 4048

Functions

static int CIN_OGM_LoadBlockToSync (cinematic_t *cin)
static int CIN_OGM_LoadPagesToStream (cinematic_t *cin)
static qboolean CIN_OGM_LoadAudioFrame (cinematic_t *cin)
static int CIN_OGM_LoadVideoFrame (cinematic_t *cin)
static qboolean CIN_OGM_LoadFrame (cinematic_t *cin)
int CIN_OGM_PlayCinematic (cinematic_t *cin, const char *filename)
static void CIN_OGM_DrawCinematic (cinematic_t *cin)
qboolean CIN_OGM_RunCinematic (cinematic_t *cin)
void CIN_OGM_StopCinematic (cinematic_t *cin)
void CIN_OGM_Init (void)

Variables

static yuvTable_t ogmCin_yuvTable
static byte rawBuffer [SIZEOF_RAWBUFF]

Detailed Description

Note:
Taken from World Of Padman Engine
This is a "ogm"-decoder to use a "better" (smaller files, higher resolutions) Cinematic-Format than roq In this code "ogm" is only: ogg wrapper, vorbis audio, xvid video (or theora video) (ogm(Ogg Media) in general is ogg wrapper with all kind of audio/video/subtitle/...)

Definition in file cl_cinematic_ogm.c.


Define Documentation

#define OGG_BUFFER_SIZE   (8 * 1024)

Definition at line 39 of file cl_cinematic_ogm.c.

Referenced by CIN_OGM_LoadBlockToSync().

#define OGM_CINEMATIC_BPP   4

Definition at line 85 of file cl_cinematic_ogm.c.

#define OGMCIN   (*((ogmCinematic_t*)cin->codecData))
#define SIZEOF_RAWBUFF   SAMPLE_SIZE * 4048

Definition at line 220 of file cl_cinematic_ogm.c.


Function Documentation

static void CIN_OGM_DrawCinematic ( cinematic_t cin  )  [static]
void CIN_OGM_Init ( void   ) 

Definition at line 794 of file cl_cinematic_ogm.c.

References f, long(), yuvTable_t::ub, yuvTable_t::ug, yuvTable_t::vg, yuvTable_t::vr, and yuvTable_t::yy.

Referenced by CIN_Init().

static qboolean CIN_OGM_LoadAudioFrame ( cinematic_t cin  )  [static]
Returns:
true if audio wants more packets

Definition at line 226 of file cl_cinematic_ogm.c.

References f, i, int(), left, M_AddToSampleBuffer(), cinematic_s::noSound, OGMCIN, and right.

Referenced by CIN_OGM_LoadFrame().

static int CIN_OGM_LoadBlockToSync ( cinematic_t cin  )  [static]
Returns:
!0 -> no data transferred

Definition at line 170 of file cl_cinematic_ogm.c.

References FS_Read(), OGG_BUFFER_SIZE, and OGMCIN.

Referenced by CIN_OGM_LoadFrame(), and CIN_OGM_PlayCinematic().

static qboolean CIN_OGM_LoadFrame ( cinematic_t cin  )  [static]
Returns:
true => noDataTransfered

Definition at line 487 of file cl_cinematic_ogm.c.

References CIN_OGM_LoadAudioFrame(), CIN_OGM_LoadBlockToSync(), CIN_OGM_LoadPagesToStream(), CIN_OGM_LoadVideoFrame(), OGMCIN, qfalse, and qtrue.

Referenced by CIN_OGM_RunCinematic().

static int CIN_OGM_LoadPagesToStream ( cinematic_t cin  )  [static]
Returns:
!0 -> no data transferred (or not for all streams)

Definition at line 188 of file cl_cinematic_ogm.c.

References OGMCIN.

Referenced by CIN_OGM_LoadFrame(), and CIN_OGM_PlayCinematic().

static int CIN_OGM_LoadVideoFrame ( cinematic_t cin  )  [static]
Returns:
1 -> loaded a new frame (OGMCIN.outputBuffer points to the actual frame), 0 -> no new frame <0 -> error
1 -> loaded a new frame (OGMCIN.outputBuffer points to the actual frame), 0 -> no new frame <0 -> error

Definition at line 462 of file cl_cinematic_ogm.c.

References OGMCIN.

Referenced by CIN_OGM_LoadFrame().

int CIN_OGM_PlayCinematic ( cinematic_t cin,
const char *  filename 
)
Returns:
0 -> no problem
Todo:

vorbis/theora-header & init in sub-functions

"clean" error-returns ...

Todo:
FIXME? can serialno be 0 in ogg? (better way to check initialized?)
Todo:
support for more than one audio stream? / detect files with one stream(or without correct ones)
Todo:
FIXME? better way to find audio stream

Definition at line 563 of file cl_cinematic_ogm.c.

References CIN_OGM_LoadBlockToSync(), CIN_OGM_LoadPagesToStream(), CIN_OGM_StopCinematic(), CINEMATIC_TYPE_OGM, cinematic_s::cinematicType, CL_Milliseconds(), cinematic_s::codecData, Com_Printf(), FILE_READ, FS_OpenFile(), M_PlayMusicStream(), Mem_PoolAlloc, OGMCIN, qtrue, and vid_genericPool.

Referenced by CIN_PlayCinematic().

qboolean CIN_OGM_RunCinematic ( cinematic_t cin  ) 
Returns:
true if the cinematic is still running, false otherwise

Definition at line 745 of file cl_cinematic_ogm.c.

References CIN_OGM_DrawCinematic(), CIN_OGM_LoadFrame(), CL_Milliseconds(), OGMCIN, qfalse, and qtrue.

Referenced by CIN_RunCinematic().

void CIN_OGM_StopCinematic ( cinematic_t cin  ) 

Variable Documentation

Definition at line 81 of file cl_cinematic_ogm.c.

byte rawBuffer[SIZEOF_RAWBUFF] [static]

Definition at line 221 of file cl_cinematic_ogm.c.


Generated by  doxygen 1.6.2