apps/camogm/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.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 69 of file camogm_mov.c.

Referenced by camogm_start_mov().


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 184 of file camogm_mov.c.

Referenced by camogm_stop().

int camogm_frame_mov ( void   ) 

Definition at line 162 of file camogm_mov.c.

Referenced by sendImageFrame().

void camogm_free_mov ( void   ) 

Definition at line 138 of file camogm_mov.c.

Referenced by camogm_free().

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 111 of file camogm_mov.c.

Referenced by camogm_set_format(), and camogm_start().

int camogm_start_mov ( void   ) 

Definition at line 145 of file camogm_mov.c.

Referenced by camogm_start().

int parse ( int  top  ) 

Definition at line 338 of file camogm_mov.c.

References comStr, d, D4, D5, debug_file, hexStr, iFile, iFileLen, iPos, camogm_state::ivf, ofd, parse_special(), putBigEndian(), SEEK_CUR, SEEK_SET, sfgets(), state, and write.

Referenced by quicktime_template_parser().

int parse_special ( void   ) 

Definition at line 263 of file camogm_mov.c.

References D0, D4, debug_file, framesize, headerSize, height, iFile, iFileLen, iPos, n, nframes, ofd, putBigEndian(), sample_dur, samplesPerChunk, SEEK_CUR, sizes, time, timescale, width, and write.

Referenced by parse().

void putBigEndian ( unsigned long  d,
int  l 
)

Definition at line 240 of file camogm_mov.c.

References ofd, and write.

Referenced by parse(), and parse_special().

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)

Definition at line 422 of file camogm_mov.c.

References D3, debug_file, framesize, headerSize, height, iFile, iFileLen, iPos, nframes, ofd, parse(), sample_dur, samplesPerChunk, SEEK_CUR, SEEK_SET, sizes, timescale, and width.

Referenced by camogm_end_mov().

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 250 of file camogm_mov.c.

References eol, and memcpy().

Referenced by parse().


Variable Documentation

char comStr[1024]

Definition at line 76 of file camogm_mov.c.

Referenced by parse().

int framesize = 80000

Definition at line 82 of file camogm_mov.c.

Referenced by parse_special(), and quicktime_template_parser().

long headerSize = 0

Definition at line 90 of file camogm_mov.c.

Referenced by parse_special(), and quicktime_template_parser().

int height = 1024

Definition at line 78 of file camogm_mov.c.

Referenced by createDefaultConfig(), image_table8(), mt9x001_pgm_limitfps(), parse_special(), pgm_hist(), pgm_window_common(), png_handle_IHDR(), png_handle_sCAL(), printPage(), quicktime_template_parser(), showImgData(), test_one_file(), and write_png().

const char hexStr[] = "0123456789abcdef"

for the parser

Definition at line 74 of file camogm_mov.c.

Referenced by parse().

const char* iFile = NULL

Definition at line 91 of file camogm_mov.c.

Referenced by parse(), parse_special(), and quicktime_template_parser().

int iFileLen

Definition at line 88 of file camogm_mov.c.

Referenced by parse(), parse_special(), and quicktime_template_parser().

int iPos

Definition at line 85 of file camogm_mov.c.

Referenced by parse(), parse_special(), and quicktime_template_parser().

int nframes = 100

Definition at line 79 of file camogm_mov.c.

Referenced by parse_special(), and quicktime_template_parser().

int ofd

position in the string "iFile"

Definition at line 87 of file camogm_mov.c.

Referenced by parse(), parse_special(), putBigEndian(), and quicktime_template_parser().

char* q_template = NULL

Definition at line 89 of file camogm_mov.c.

Referenced by camogm_end_mov(), camogm_free_mov(), and camogm_init_mov().

const char qtSourceFileName[] = "/etc/qt_source"

Definition at line 75 of file camogm_mov.c.

Referenced by camogm_init_mov().

int sample_dur = 80

Definition at line 80 of file camogm_mov.c.

Referenced by parse_special(), and quicktime_template_parser().

int samplesPerChunk = 10

Definition at line 81 of file camogm_mov.c.

Referenced by parse_special(), and quicktime_template_parser().

int* sizes

Definition at line 84 of file camogm_mov.c.

Referenced by parse_special(), quicktime_template_parser(), xi2c_init(), xi2c_lseek(), xi2c_open(), xi2c_read(), and xi2c_write().

int timescale = 600

Definition at line 83 of file camogm_mov.c.

Referenced by camogm_end_mov(), camogm_start(), parse_special(), and quicktime_template_parser().

int width = 1280

Definition at line 77 of file camogm_mov.c.

Referenced by createDefaultConfig(), image_table8(), mt9x001_pgm_limitfps(), parse_special(), pgm_hist(), pgm_window_common(), png_handle_IHDR(), png_handle_sCAL(), printPage(), quicktime_template_parser(), showImgData(), test_one_file(), and write_png().


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