#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_ogm.h"
#include "camogm.h"
Include dependency graph for camogm_ogm.c:
Go to the source code of this file.
Data Structures | |
struct | ogm_stream_t |
Not all are needed, just copied from the camogm.c. More... | |
Functions | |
int | ogm_flush_to_file (struct ogm_stream_t *stream) |
int | camogm_audio_init (void) |
int | camogm_audio_end (void) |
int | camogm_init_ogm (void) |
may add something - called first time format is changed to this one (only once) recording is stopped | |
void | camogm_free_ogm (void) |
int | camogm_start_ogm (void) |
int | camogm_frame_ogm (void) |
int | camogm_end_ogm (void) |
Zero packets are OK, use them to end file with "last" turned on. | |
void | camogm_audio_ogm_push (void *buf, int len, long granules_shift, int prefix) |
Variables | |
ogm_stream_t | svideo |
ogm_stream_t | saudio |
int camogm_audio_end | ( | void | ) |
Definition at line 323 of file camogm_ogm.c.
References buf, ogm_stream_t::granulepos, ogm_flush_to_file(), ogm_stream_t::os, ogm_stream_t::packetno, and saudio.
Referenced by camogm_end_ogm().
int camogm_audio_init | ( | void | ) |
Definition at line 256 of file camogm_ogm.c.
References stream_header::audio, camogm_state::audio_channels, camogm_state::audio_rate, stream_header_audio::avgbytespersec, stream_header::bits_per_sample, stream_header_audio::blockalign, stream_header::buffersize, stream_header_audio::channels, stream_header::default_len, ogm_stream_t::granulepos, memcpy(), memset(), ogm_flush_to_file(), ogm_stream_t::os, PACKET_TYPE_COMMENT, ogm_stream_t::packetno, put_uint16(), put_uint32(), put_uint64(), stream_header::samples_per_unit, saudio, stream_header::sh, stream_header::size, state, stream_header::streamtype, stream_header::subtype, and stream_header::time_unit.
Referenced by camogm_start_ogm().
void camogm_audio_ogm_push | ( | void * | buf, | |
int | len, | |||
long | granules_shift, | |||
int | prefix | |||
) |
Definition at line 340 of file camogm_ogm.c.
References ogm_stream_t::granulepos, ogm_flush_to_file(), ogm_stream_t::os, PACKET_IS_SYNCPOINT, ogm_stream_t::packetno, and saudio.
Referenced by audio_process().
int camogm_end_ogm | ( | void | ) |
Zero packets are OK, use them to end file with "last" turned on.
put zero-packet it into stream
+++++++++++++++++++++++++++++++++++++++++++++++++++++
Definition at line 235 of file camogm_ogm.c.
References camogm_state::audio_enable, buf, camogm_audio_end(), CAMOGM_FRAME_FILE_ERR, D0, debug_file, camogm_state::granulepos, ogm_stream_t::granulepos, camogm_state::og, ogm_flush_to_file(), camogm_state::os, ogm_stream_t::os, camogm_state::packetno, ogm_stream_t::packetno, state, svideo, and camogm_state::vf.
int camogm_frame_ogm | ( | void | ) |
Definition at line 191 of file camogm_ogm.c.
References camogm_state::allow_sync, CAMOGM_FRAME_FILE_ERR, camogm_state::chunk_index, D0, debug_file, camogm_state::granulepos, ogm_stream_t::granulepos, camogm_state::og, ogm_flush_to_file(), camogm_state::os, ogm_stream_t::os, camogm_state::packetchunks, camogm_state::packetno, ogm_stream_t::packetno, state, svideo, camogm_state::timescale, and camogm_state::vf.
void camogm_free_ogm | ( | void | ) |
Definition at line 98 of file camogm_ogm.c.
int camogm_init_ogm | ( | void | ) |
may add something - called first time format is changed to this one (only once) recording is stopped
*************************************************************************** ! FILE NAME : camogm_ogm.c ! DESCRIPTION: Provides writing to ogm files for camogm ! 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 94 of file camogm_ogm.c.
int camogm_start_ogm | ( | void | ) |
Definition at line 101 of file camogm_ogm.c.
References camogm_state::audio_enable, camogm_audio_init(), CAMOGM_FRAME_FILE_ERR, D0, D2, debug_file, camogm_state::frame_params, camogm_state::granulepos, ogm_stream_t::granulepos, camogm_state::height, memcpy(), memset(), camogm_state::og, ogm_flush_to_file(), camogm_state::os, ogm_stream_t::os, PACKET_TYPE_COMMENT, camogm_state::packetno, ogm_stream_t::packetno, camogm_state::path, camogm_state::path_prefix, put_uint16(), put_uint32(), put_uint64(), camogm_state::serialno, stream_header::size, state, stream_header::streamtype, stream_header::subtype, svideo, camogm_state::time_unit, camogm_state::timescale, interframe_params_t::timestamp_sec, interframe_params_t::timestamp_usec, camogm_state::vf, and camogm_state::width.
int ogm_flush_to_file | ( | struct ogm_stream_t * | stream | ) |
Definition at line 77 of file camogm_ogm.c.
References CAMOGM_FRAME_FILE_ERR, D2, debug_file, ogm_stream_t::og, ogm_stream_t::os, state, and camogm_state::vf.
Referenced by camogm_audio_end(), camogm_audio_init(), camogm_audio_ogm_push(), camogm_end_ogm(), camogm_frame_ogm(), and camogm_start_ogm().
struct ogm_stream_t saudio |
Definition at line 75 of file camogm_ogm.c.
Referenced by camogm_audio_end(), camogm_audio_init(), and camogm_audio_ogm_push().
struct ogm_stream_t svideo |
Definition at line 74 of file camogm_ogm.c.
Referenced by camogm_end_ogm(), camogm_frame_ogm(), and camogm_start_ogm().