apps/camogm2/camogm_mov.c File Reference

#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 Documentation

#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/>. ! -----------------------------------------------------------------------------** ! !

Log
camogm_mov.c,v
! Revision 1.1.1.1 2008/11/27 20:04:01 elphel ! ! ! Revision 1.1 2008/05/02 12:45:58 spectr_rain ! initial revision with the sound support ! ! Revision 1.4 2008/04/11 23:09:33 elphel ! modified to handle kml generation ! ! Revision 1.3 2007/11/19 17:00:20 elphel ! removed wrong dependency ! ! Revision 1.2 2007/11/19 03:23:21 elphel ! 7.1.5.5 Added support for *.mov files in camogm. ! ! Revision 1.1 2007/11/16 08:49:57 elphel ! Initial release of camogm - program to record video/image to the camera hard drive (or other storage) !

Definition at line 72 of file camogm_mov.c.


Function Documentation

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   ) 

Definition at line 141 of file camogm_mov.c.

References free(), and q_template.

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 
)

Parameters:
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.

References eol, and memcpy().


Variable Documentation

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"

for the parser

Definition at line 77 of file camogm_mov.c.

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

position in the string "iFile"

Definition at line 90 of file camogm_mov.c.

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.


Generated on Fri Nov 28 00:06:56 2008 for elphel by  doxygen 1.5.1