#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <fcntl.h>
#include <sys/uio.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <time.h>
#include <string.h>
#include <netinet/in.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
#include <asm/elphel/c313a.h>
#include <asm/elphel/ext353.h>
#include <asm/byteorder.h>
#include <ogg/ogg.h>
#include "ogmstreams.h"
#include "camogm_mov.h"
#include "camogm.h"
Include dependency graph for camogm_mov.c:
Go to the source code of this file.
Defines | |
#define | QUICKTIME_MIN_HEADER 0x300 |
Not all are needed, just copied from the camogm.c. | |
Functions | |
int | quicktime_template_parser (const char *i_iFile, int i_ofd, int i_width, int i_height, int i_nframes, int i_sample_dur, int i_samplesPerChunk, int i_framesize, int i_timescale, int *i_sizes, int data_start) |
void | putBigEndian (unsigned long d, int l) |
int | parse_special (void) |
int | parse (int top) |
int | camogm_init_mov (void) |
void | camogm_free_mov (void) |
int | camogm_start_mov (void) |
int | camogm_frame_mov (void) |
int | camogm_audio_mov (void *buf, int len, int slen) |
int | camogm_end_mov (void) |
move to the start of the file and insert generated header | |
char * | sfgets (char *str, int size, const char *stream, int *pos) |
temporary replacement for fgets to read from string | |
Variables | |
const char | hexStr [] = "0123456789abcdef" |
for the parser | |
char | qtSourceFileName_video [] = "/etc/qt_video" |
* | |
char | qtSourceFileName_audio [] = "/etc/qt_audio" |
char * | qtSourceFileName = NULL |
char | comStr [1024] |
int | width = 1280 |
int | height = 1024 |
int | nframes = 100 |
int | sample_dur = 80 |
int | samplesPerChunk = 10 |
int | framesize = 80000 |
int | timescale = 600 |
int * | sizes |
int | iPos |
int | ofd |
position in the string "iFile" | |
int | iFileLen |
char * | q_template = NULL |
long | headerSize = 0 |
const char * | iFile = NULL |
unsigned long | audio_rate = 0 |
unsigned short | audio_channels = 0 |
int | audio_timescale |
long | audio_duration |
#define QUICKTIME_MIN_HEADER 0x300 |
Not all are needed, just copied from the camogm.c.
*************************************************************************** ! FILE NAME : camogm_mov.c ! DESCRIPTION: Provides writing to file compatible with Apple Quicktime(R) for camogm !TODO: Nothing yet here, will be added ASAP ! Copyright (C) 2007 Elphel, Inc. ! -----------------------------------------------------------------------------** ! This program is free software: you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation, either version 3 of the License, or ! (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program. If not, see <http://www.gnu.org/licenses/>. ! -----------------------------------------------------------------------------** ! !
Definition at line 78 of file camogm_mov.c.
Definition at line 234 of file camogm_mov.c.
References CAMOGM_FRAME_FILE_ERR, D0, debug_file, state, and write.
Referenced by audio_process().
int camogm_end_mov | ( | void | ) |
move to the start of the file and insert generated header
frame period measured in 1/10000 of a second?
that was in old code. If that works - try to switch to microseconds
4-byte length+"mdat"
now - string containing header template
output file descriptor (opened)
width in pixels
frame size - will look in the table
array of frame lengths to build an index
free memory used for index
Definition at line 267 of file camogm_mov.c.
References D4, debug_file, free(), he, autoexp_t::height, q_template, quicktime_template_parser(), read, state, stderr, timescale, autoexp_t::width, and write.
int camogm_frame_mov | ( | void | ) |
Definition at line 204 of file camogm_mov.c.
References CAMOGM_FRAME_FILE_ERR, D0, debug_file, state, and stderr.
void camogm_free_mov | ( | void | ) |
int camogm_init_mov | ( | void | ) |
called first time format is changed to this one (only once) recording is stopped read frame template from the file if it is not done yet
Definition at line 131 of file camogm_mov.c.
References context_audio_t::audio_present, CAMOGM_FRAME_FILE_ERR, CAMOGM_FRAME_MALLOC, ctx_a, D0, debug_file, free(), malloc(), q_template, qtSourceFileName, qtSourceFileName_audio, and qtSourceFileName_video.
int camogm_start_mov | ( | void | ) |
Definition at line 168 of file camogm_mov.c.
References context_audio_t::audio_present, CAMOGM_FRAME_FILE_ERR, CAMOGM_FRAME_MALLOC, ctx_a, D0, DA, debug_file, malloc(), QUICKTIME_MIN_HEADER, state, and stderr.
Definition at line 95 of file qtime.c.
References comStr, D, hexStr, infile, outfile, parse(), parse_special(), and putBigEndian().
int parse_special | ( | void | ) |
Definition at line 38 of file qtime.c.
References D, framesize, headerSize, height, infile, nframes, putBigEndian(), sample_dur, samplesPerChunk, sizes, time, timescale, and width.
void putBigEndian | ( | unsigned long | d, | |
int | l | |||
) |
int quicktime_template_parser | ( | const char * | i_iFile, | |
int | i_ofd, | |||
int | i_width, | |||
int | i_height, | |||
int | i_nframes, | |||
int | i_sample_dur, | |||
int | i_samplesPerChunk, | |||
int | i_framesize, | |||
int | i_timescale, | |||
int * | i_sizes, | |||
int | data_start | |||
) |
i_ofd | now - string containing header template |
i_width | output file descriptor (opened) |
temporary replacement for fgets to read from string
pointer to last before
Definition at line 323 of file camogm_mov.c.
unsigned short audio_channels = 0 |
Definition at line 109 of file camogm_mov.c.
long audio_duration |
Definition at line 111 of file camogm_mov.c.
unsigned long audio_rate = 0 |
Definition at line 108 of file camogm_mov.c.
Definition at line 110 of file camogm_mov.c.
char comStr[1024] |
Definition at line 91 of file camogm_mov.c.
Definition at line 97 of file camogm_mov.c.
long headerSize = 0 |
Definition at line 105 of file camogm_mov.c.
Definition at line 93 of file camogm_mov.c.
const char hexStr[] = "0123456789abcdef" |
const char* iFile = NULL |
Definition at line 106 of file camogm_mov.c.
Definition at line 103 of file camogm_mov.c.
Definition at line 100 of file camogm_mov.c.
Definition at line 94 of file camogm_mov.c.
char* q_template = NULL |
Definition at line 104 of file camogm_mov.c.
char* qtSourceFileName = NULL |
Definition at line 90 of file camogm_mov.c.
char qtSourceFileName_audio[] = "/etc/qt_audio" |
char qtSourceFileName_video[] = "/etc/qt_video" |
int sample_dur = 80 |
Definition at line 95 of file camogm_mov.c.
int samplesPerChunk = 10 |
Definition at line 96 of file camogm_mov.c.
Definition at line 99 of file camogm_mov.c.
Definition at line 98 of file camogm_mov.c.
Definition at line 92 of file camogm_mov.c.