Fork me on GitHub
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Typedefs | Functions
record.h File Reference

Audio/Video recorder. More...

#include <inttypes.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include "mutex.h"
Include dependency graph for record.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  janus_recorder
 Structure that represents a recorder. More...

Typedefs

typedef struct janus_recorder janus_recorder
 Structure that represents a recorder.

Functions

janus_recorderjanus_recorder_create (const char *dir, int video, const char *filename)
 Create a new recorder.
int janus_recorder_save_frame (janus_recorder *recorder, char *buffer, int length)
 Save an RTP frame in the recorder.
int janus_recorder_close (janus_recorder *recorder)
 Close the recorder.
int janus_recorder_free (janus_recorder *recorder)
 Free the recorder resources.

Detailed Description

Audio/Video recorder.

Audio/Video recorder (headers)

Author
Lorenzo Miniero loren.nosp@m.zo@m.nosp@m.eetec.nosp@m.ho.c.nosp@m.om

Implementation of a simple recorder utility that plugins can make use of to record audio/video frames to a Janus file. This file just saves RTP frames in a structured way, so that they can be post-processed later on to get a valid container file (e.g., a .opus file for Opus audio or a .webm file for VP8 video) and keep things simpler on the plugin and core side.

Note
If you want to record both audio and video, you'll have to use two different recorders. Any muxing in the same container will have to be done in the post-processing phase.

Core

Typedef Documentation

Structure that represents a recorder.

Function Documentation

int janus_recorder_close ( janus_recorder recorder)

Close the recorder.

Parameters
[in]recorderThe janus_recorder instance to close
Returns
0 in case of success, a negative integer otherwise
janus_recorder* janus_recorder_create ( const char *  dir,
int  video,
const char *  filename 
)

Create a new recorder.

Note
If no target directory is provided, the current directory will be used. If no filename is passed, a random filename will be used.
Parameters
[in]dirPath of the directory to save the recording into (will try to create it if it doesn't exist)
[in]videoIf this recorder is for video or audio
[in]filenameFilename to use for the recording
Returns
A valid janus_recorder instance in case of success, NULL otherwise
int janus_recorder_free ( janus_recorder recorder)

Free the recorder resources.

Parameters
[in]recorderThe janus_recorder instance to free
Returns
0 in case of success, a negative integer otherwise
int janus_recorder_save_frame ( janus_recorder recorder,
char *  buffer,
int  length 
)

Save an RTP frame in the recorder.

Parameters
[in]recorderThe janus_recorder instance to save the frame to
[in]bufferThe frame data to save
[in]lengthThe frame data length
Returns
0 in case of success, a negative integer otherwise