#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_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 | |
const char | qtSourceFileName [] = "/etc/qt_source" |
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 |
#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 72 of file camogm_mov.c.
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 187 of file camogm_mov.c.
References D4, debug_file, camogm_state::frame_data_start, camogm_state::frame_lengths, camogm_state::frame_period, camogm_state::frameno, camogm_state::frames_per_chunk, free(), he, camogm_state::height, camogm_state::ivf, q_template, quicktime_template_parser(), read, SEEK_CUR, SEEK_SET, state, camogm_state::timescale, timescale, camogm_state::width, and write.
int camogm_frame_mov | ( | void | ) |
Definition at line 165 of file camogm_mov.c.
References CAMOGM_FRAME_FILE_ERR, camogm_state::chunk_index, D0, debug_file, camogm_state::frame_lengths, camogm_state::frameno, camogm_state::ivf, camogm_state::packetchunks, and state.
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 114 of file camogm_mov.c.
References CAMOGM_FRAME_FILE_ERR, CAMOGM_FRAME_MALLOC, D0, debug_file, free(), malloc(), q_template, qtSourceFileName, SEEK_END, SEEK_SET, and size.
int camogm_start_mov | ( | void | ) |
Definition at line 148 of file camogm_mov.c.
References CAMOGM_FRAME_FILE_ERR, CAMOGM_FRAME_MALLOC, D0, debug_file, camogm_state::frame_data_start, camogm_state::frame_lengths, camogm_state::frame_params, camogm_state::frames_per_chunk, camogm_state::ivf, malloc(), camogm_state::max_frames, camogm_state::path, camogm_state::path_prefix, QUICKTIME_MIN_HEADER, SEEK_SET, state, interframe_params_t::timestamp_sec, and interframe_params_t::timestamp_usec.
int parse | ( | int | top | ) |
int parse_special | ( | void | ) |
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) |
char* sfgets | ( | char * | str, | |
int | size, | |||
const char * | stream, | |||
int * | pos | |||
) |
temporary replacement for fgets to read from string
pointer to last before
Definition at line 253 of file camogm_mov.c.
char comStr[1024] |
Definition at line 79 of file camogm_mov.c.
int framesize = 80000 |
Definition at line 85 of file camogm_mov.c.
long headerSize = 0 |
Definition at line 93 of file camogm_mov.c.
int height = 1024 |
Definition at line 81 of file camogm_mov.c.
const char hexStr[] = "0123456789abcdef" |
const char* iFile = NULL |
Definition at line 94 of file camogm_mov.c.
int iFileLen |
Definition at line 91 of file camogm_mov.c.
int iPos |
Definition at line 88 of file camogm_mov.c.
int nframes = 100 |
Definition at line 82 of file camogm_mov.c.
int ofd |
char* q_template = NULL |
Definition at line 92 of file camogm_mov.c.
const char qtSourceFileName[] = "/etc/qt_source" |
Definition at line 78 of file camogm_mov.c.
int sample_dur = 80 |
Definition at line 83 of file camogm_mov.c.
int samplesPerChunk = 10 |
Definition at line 84 of file camogm_mov.c.
int* sizes |
Definition at line 87 of file camogm_mov.c.
int timescale = 600 |
Definition at line 86 of file camogm_mov.c.
int width = 1280 |
Definition at line 80 of file camogm_mov.c.