Fork me on GitHub
record.h
Go to the documentation of this file.
1 
19 #ifndef _JANUS_RECORD_H
20 #define _JANUS_RECORD_H
21 
22 #include <inttypes.h>
23 #include <string.h>
24 #include <stdio.h>
25 #include <stdlib.h>
26 
27 #include "mutex.h"
28 
29 
31 typedef enum janus_recorder_medium {
36 
38 typedef struct janus_recorder {
40  char *dir;
42  char *filename;
44  FILE *file;
46  char *codec;
48  gint64 created;
52  volatile int header;
54  volatile int writable;
58 
62 void janus_recorder_init(gboolean tempnames, const char *extension);
64 void janus_recorder_deinit(void);
65 
73 janus_recorder *janus_recorder_create(const char *dir, const char *codec, const char *filename);
79 int janus_recorder_save_frame(janus_recorder *recorder, char *buffer, uint length);
87 int janus_recorder_free(janus_recorder *recorder);
88 
89 #endif
int janus_recorder_free(janus_recorder *recorder)
Free the recorder resources.
Definition: record.c:273
char * codec
Codec the packets to record are encoded in ("vp8", "opus", "h264", "g711", "vp9") ...
Definition: record.h:46
gint64 created
When the recording file has been created.
Definition: record.h:48
Definition: record.h:34
janus_mutex mutex
Mutex to lock/unlock this recorder instance.
Definition: record.h:56
int janus_recorder_save_frame(janus_recorder *recorder, char *buffer, uint length)
Save an RTP frame in the recorder.
Definition: record.c:170
char * dir
Absolute path to the directory where the recorder file is stored.
Definition: record.h:40
volatile int writable
Whether this recorder instance can be used for writing or not.
Definition: record.h:54
Definition: record.h:33
Definition: record.h:32
volatile int header
Whether the info header for this recorder instance has already been written or not.
Definition: record.h:52
void janus_recorder_deinit(void)
De-initialize the recorder code.
Definition: record.c:58
janus_recorder * janus_recorder_create(const char *dir, const char *codec, const char *filename)
Create a new recorder.
Definition: record.c:64
FILE * file
Recording file.
Definition: record.h:44
janus_recorder_medium type
Media this instance is recording.
Definition: record.h:50
int janus_recorder_close(janus_recorder *recorder)
Close the recorder.
Definition: record.c:235
Structure that represents a recorder.
Definition: record.h:38
void janus_recorder_init(gboolean tempnames, const char *extension)
Initialize the recorder code.
Definition: record.c:44
struct janus_recorder janus_recorder
Structure that represents a recorder.
Semaphors, Mutexes and Conditions.
pthread_mutex_t janus_mutex
Janus mutex implementation.
Definition: mutex.h:19
char * filename
Filename of this recorder file.
Definition: record.h:42
janus_recorder_medium
Media types we can record.
Definition: record.h:31