Fork me on GitHub
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
record.c File Reference
#include <arpa/inet.h>
#include <sys/stat.h>
#include <errno.h>
#include "record.h"
#include "debug.h"
#include "utils.h"
Include dependency graph for record.c:

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.

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