type
stringclasses
5 values
content
stringlengths
9
163k
functions
void rtsp_reply_header(HTTPContext *c, enum RTSPStatusCode error_number) { const char *str; time_t ti; char *p; char buf2[32]; switch(error_number) { #include "rtspcodes.h" #undef DEF default: str = "Unknown Error"; break; }
functions
void rtsp_reply_error(HTTPContext *c, enum RTSPStatusCode error_number) { rtsp_reply_header(c, error_number); url_fprintf(c->pb, "\r\n"); }
functions
int rtsp_parse_request(HTTPContext *c) { const char *p, *p1, *p2; char cmd[32]; char url[1024]; char protocol[32]; char line[1024]; ByteIOContext pb1; int len; RTSPHeader header1, *header = &header1; c->buffer_ptr[0] = '\0'; p = c->buffer; get_word(cmd, sizeof(cmd),...
functions
int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer, struct in_addr my_ip) { ByteIOContext pb1, *pb = &pb1; int i, payload_type, port, private_payload_type, j; const char *ipstr, *title, *mediatype; AVStream *st; if (url_open_dyn_buf(pb) < 0) ...
functions
void rtsp_cmd_options(HTTPContext *c, const char *url) { // rtsp_reply_header(c, RTSP_STATUS_OK); url_fprintf(c->pb, "RTSP/1.0 %d %s\r\n", RTSP_STATUS_OK, "OK"); url_fprintf(c->pb, "CSeq: %d\r\n", c->seq); url_fprintf(c->pb, "Public: %s\r\n", "OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE"); url_fp...
functions
void rtsp_cmd_describe(HTTPContext *c, const char *url) { FFStream *stream; char path1[1024]; const char *path; uint8_t *content; int content_length, len; struct sockaddr_in my_addr; /* find which url is asked */ url_split(NULL, 0, NULL, 0, NULL, 0, NULL, path1, sizeof(path1), url);...
functions
void rtsp_cmd_setup(HTTPContext *c, const char *url, RTSPHeader *h) { FFStream *stream; int stream_index, port; char buf[1024]; char path1[1024]; const char *path; HTTPContext *rtp_c; RTSPTransportField *th; struct sockaddr_in dest_addr; RTSPActionServerSe...
functions
void rtsp_cmd_play(HTTPContext *c, const char *url, RTSPHeader *h) { HTTPContext *rtp_c; rtp_c = find_rtp_session_with_url(url, h->session_id); if (!rtp_c) { rtsp_reply_error(c, RTSP_STATUS_SESSION); return; }
functions
void rtsp_cmd_pause(HTTPContext *c, const char *url, RTSPHeader *h) { HTTPContext *rtp_c; rtp_c = find_rtp_session_with_url(url, h->session_id); if (!rtp_c) { rtsp_reply_error(c, RTSP_STATUS_SESSION); return; }
functions
void rtsp_cmd_teardown(HTTPContext *c, const char *url, RTSPHeader *h) { HTTPContext *rtp_c; rtp_c = find_rtp_session_with_url(url, h->session_id); if (!rtp_c) { rtsp_reply_error(c, RTSP_STATUS_SESSION); return; }
functions
int rtp_new_av_stream(HTTPContext *c, int stream_index, struct sockaddr_in *dest_addr, HTTPContext *rtsp_c) { AVFormatContext *ctx; AVStream *st; char *ipaddr; URLContext *h; uint8_t *dummy_buf; char buf2[32]; int max_packet_size; ...
functions
int add_av_stream(FFStream *feed, AVStream *st) { AVStream *fst; AVCodecContext *av, *av1; int i; av = &st->codec; for(i=0;i<feed->nb_streams;i++) { st = feed->streams[i]; av1 = &st->codec; if (av1->codec_id == av->codec_id && av1->codec_type == av->codec_type &&...
functions
void remove_stream(FFStream *stream) { FFStream **ps; ps = &first_stream; while (*ps != NULL) { if (*ps == stream) { *ps = (*ps)->next; }
functions
void extract_mpeg4_header(AVFormatContext *infile) { int mpeg4_count, i, size; AVPacket pkt; AVStream *st; const uint8_t *p; mpeg4_count = 0; for(i=0;i<infile->nb_streams;i++) { st = infile->streams[i]; if (st->codec.codec_id == CODEC_ID_MPEG4 && st->codec.extradata_...
functions
void build_file_streams(void) { FFStream *stream, *stream_next; AVFormatContext *infile; int i; /* gather all streams */ for(stream = first_stream; stream != NULL; stream = stream_next) { stream_next = stream->next; if (stream->stream_type == STREAM_TYPE_LIVE && !stream-...
functions
void build_feed_streams(void) { FFStream *stream, *feed; int i; /* gather all streams */ for(stream = first_stream; stream != NULL; stream = stream->next) { feed = stream->feed; if (feed) { if (!stream->is_feed) { /* we handle a stream coming from a feed */ ...
functions
else if (ccf->codec_type == CODEC_TYPE_VIDEO) { if (CHECK_CODEC(frame_rate) || CHECK_CODEC(frame_rate_base) || CHECK_CODEC(width) || CHECK_CODEC(height)) { ...
functions
else if (ccf->codec_type == CODEC_TYPE_AUDIO) { if (CHECK_CODEC(sample_rate) || CHECK_CODEC(channels) || CHECK_CODEC(frame_size)) { printf("Codec sample_rate, channels, frame_size ...
functions
void compute_bandwidth(void) { int bandwidth, i; FFStream *stream; for(stream = first_stream; stream != NULL; stream = stream->next) { bandwidth = 0; for(i=0;i<stream->nb_streams;i++) { AVStream *st = stream->streams[i]; switch(st->codec.codec_type) { ...
functions
void get_arg(char *buf, int buf_size, const char **pp) { const char *p; char *q; int quote; p = *pp; while (isspace(*p)) p++; q = buf; quote = 0; if (*p == '\"' || *p == '\'') quote = *p++; for(;;) { if (quote) { if (*p == quote) break; ...
functions
void add_codec(FFStream *stream, AVCodecContext *av) { AVStream *st; /* compute default parameters */ switch(av->codec_type) { case CODEC_TYPE_AUDIO: if (av->bit_rate == 0) av->bit_rate = 64000; if (av->sample_rate == 0) av->sample_rate = 22050; if (av->c...
functions
int opt_audio_codec(const char *arg) { AVCodec *p; p = first_avcodec; while (p) { if (!strcmp(p->name, arg) && p->type == CODEC_TYPE_AUDIO) break; p = p->next; }
functions
int opt_video_codec(const char *arg) { AVCodec *p; p = first_avcodec; while (p) { if (!strcmp(p->name, arg) && p->type == CODEC_TYPE_VIDEO) break; p = p->next; }
functions
void load_module(const char *filename) { void *dll; void (*init_func)(void); dll = dlopen(filename, RTLD_NOW); if (!dll) { fprintf(stderr, "Could not load module '%s' - %s\n", filename, dlerror()); return; }
functions
int parse_ffconfig(const char *filename) { FILE *f; char line[1024]; char cmd[64]; char arg[1024]; const char *p; int val, errors, line_num; FFStream **last_stream, *stream, *redirect; FFStream **last_feed, *feed; AVCodecContext audio_enc, video_enc; int audio_id, video_id; ...
functions
else if (stream) { get_arg(stream->feed_filename, sizeof(stream->feed_filename), &p); }
functions
else if (stream) { get_arg(stream->feed_filename, sizeof(stream->feed_filename), &p); }
functions
else if (feed) { naclp = &feed->acl; }
functions
void write_packet(FFCodec *ffenc, uint8_t *buf, int size) { PacketHeader hdr; AVCodecContext *enc = &ffenc->enc; uint8_t *wptr; mk_header(&hdr, enc, size); wptr = http_fifo.wptr; fifo_write(&http_fifo, (uint8_t *)&hdr, sizeof(hdr), &wptr); fifo_write(&http_fifo, buf,...
functions
void show_banner(void) { printf("ffserver version " FFMPEG_VERSION ", Copyright (c) 2000-2003 Fabrice Bellard\n"); }
functions
void show_help(void) { show_banner(); printf("usage: ffserver [-L] [-h] [-f configfile]\n" "Hyper fast multi format Audio/Video streaming server\n" "\n" "-L : print the LICENSE\n" "-h : this help\n" "-f configfile : use configfile inst...
functions
void show_license(void) { show_banner(); printf( "This library is free software; you can redistribute it and/or\n" "modify it under the terms of the GNU Lesser General Public\n" "License as published by the Free Software Foundation; either\n" "version 2 of the License, or (at your option) any la...
functions
void handle_child_exit(int sig) { pid_t pid; int status; while ((pid = waitpid(-1, &status, WNOHANG)) > 0) { FFStream *feed; for (feed = first_feed; feed; feed = feed->next) { if (feed->pid == pid) { int uptime = time(0) - feed->pid_start; feed-...
functions
else if (pid > 0) { /* parent : exit */ exit(0); }
main
int main(int argc, char **argv) { const char *config_filename; int c; struct sigaction sigact; av_register_all(); config_filename = "/etc/ffserver.conf"; my_program_name = argv[0]; my_program_dir = getcwd(0, 0); ffserver_daemon = 1; for(;;) { c = getopt(argc, argv, "n...
includes
#include <linux/kernel.h>
includes
#include <linux/init.h>
includes
#include <linux/module.h>
includes
#include <linux/moduleparam.h>
includes
#include <linux/platform_device.h>
includes
#include <linux/gpio.h>
includes
#include <linux/interrupt.h>
includes
#include <linux/workqueue.h>
includes
#include <linux/slab.h>
includes
#include <linux/delay.h>
includes
#include <linux/fs.h>
includes
#include <linux/uaccess.h>
includes
#include <linux/wakelock.h>
includes
#include <linux/spinlock.h>
includes
#include <linux/usb.h>
includes
#include <linux/pm_runtime.h>
includes
#include <linux/suspend.h>
includes
#include <mach/usb_phy.h>
includes
#include <mach/board_htc.h>
includes
#include <linux/pm_qos_params.h>
includes
#include <asm/mach-types.h>
includes
#include <mach/htc_hostdbg.h>
defines
#define MODULE_NAME "[XMM_v15]"
defines
#define BOOST_CPU_FREQ_MIN 1500000
defines
#define auto_sleep(x) \
defines
#define PRINT_GPIO(gpio,name) pr_info( "PRINT_GPIO %s <%d>", name, gpio_get_value(gpio) )
defines
#define MSIZE 30
functions
ssize_t host_dbg_show(struct device *dev, struct device_attribute *attr, char *buf) { int ret = -EINVAL; ret = sprintf(buf, "%x\n", host_dbg_flag); return ret; }
functions
ssize_t host_dbg_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t size) { const int hedge = 2 + 8 + 1; /* hedge: "0x" 2 chars, max: 8 chars, plus one 0x0a char */ pr_info(MODULE_NAME "%s size = %d\n", __func__, size); if (size > hedge) { p...
functions
int MIN( int x, int y ) { return x > y ? y : x; }
functions
ssize_t debug_handler(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { if( !strncmp( buf, "0", MIN( count, strlen("0") ) ) ) { debug_gpio_dump(); }
functions
int debug_gpio_dump() { PRINT_GPIO( TEGRA_GPIO_PM4, "BB_VDD_EN" ); PRINT_GPIO( TEGRA_GPIO_PC1, "AP2BB_RST_PWRDWNn" ); PRINT_GPIO( TEGRA_GPIO_PN0, "AP2BB_RSTn" ); PRINT_GPIO( TEGRA_GPIO_PN3, "AP2BB_PWRON" ); PRINT_GPIO( TEGRA_GPIO_PN2, "BB2AP_RADIO_FATAL" ); PRINT_GPIO( TEGRA_GPIO_PN1, "IPC_HSIC_ACTIVE" ); PRINT_...
functions
int trigger_radio_fatal_get_coredump(void) { #if 0 if (!reason) reason = "No Reason"; pr_info("Trigger Modem Fatal!! reason <%s>", reason); /*set BB2AP_SUSPEND_REQ Pin (TEGRA_GPIO_PV0) to OutPut High to trigger Modem fatal*/ int ret=gpio_direction_output(TEGRA_GPIO_PV0,1); if (ret < 0) pr_err("%s: set BB2AP...
functions
int trigger_silent_reset(char *reason) { char message[MSIZE] = "ResetReason="; char *envp[] = { message, NULL }
functions
int Modem_is_6360() { return s_sku_id == SKU_ID_ENRC2_TMO; }
functions
int Modem_is_6260() { return ( s_sku_id == SKU_ID_ENRC2_GLOBAL || s_sku_id == SKU_ID_ENDEAVORU ); }
functions
int Modem_is_IMC(void) { return ( machine_is_enrc2b() || machine_is_endeavoru() || machine_is_enrc2u() ); }
functions
irqreturn_t radio_reset_irq(int irq, void *dev_id) { pr_err("%s: Radio reset detected!", __func__); debug_gpio_dump(); return IRQ_HANDLED; }
functions
int enable_avdd_dsi_csi_power() { pr_info(MODULE_NAME "[xmm]%s\n",__func__); int ret=0; if (endeavor_dsi_reg == NULL) { endeavor_dsi_reg = regulator_get(NULL, "avdd_dsi_csi"); pr_info(MODULE_NAME "[xmm]%s regulator_getED\n",__func__); if (IS_ERR_OR_NULL(endeavor_dsi_reg)) { pr_err("dsi: Could not get regul...
functions
int disable_avdd_dsi_csi_power() { pr_info(MODULE_NAME "[xmm]%s\n",__func__); int ret=0; if (endeavor_dsi_reg == NULL) { endeavor_dsi_reg = regulator_get(NULL, "avdd_dsi_csi"); pr_info(MODULE_NAME "[xmm]%s regulator_getED\n",__func__); if (IS_ERR_OR_NULL(endeavor_dsi_reg)) { pr_err("dsi: Could not get regu...
functions
int gpio_config_only_one(unsigned gpio, unsigned long flags, const char *label) { int err=0; if (flags & GPIOF_DIR_IN) err = gpio_direction_input(gpio); else err = gpio_direction_output(gpio, (flags & GPIOF_INIT_HIGH) ? 1 : 0); return err; }
functions
int gpio_config_only_array(struct gpio *array, size_t num) { int i, err=0; for (i = 0; i < num; i++, array++) { if( array->gpio != -1 ) { err = gpio_config_only_one(array->gpio, array->flags, array->label); if (err) goto err_free; }
functions
int gpio_request_only_one(unsigned gpio,const char *label) { int err = gpio_request(gpio, label); if (err) return err; else return 0; }
functions
int gpio_request_only_array(struct gpio *array, size_t num) { int i, err=0; for (i = 0; i < num; i++, array++) { if( array->gpio != -1 ) { err = gpio_request_only_one(array->gpio, array->label); if (err) goto err_free; }
functions
int gpio_o_l_uart(int gpio, char* name) { int ret=0; pr_info(MODULE_NAME "%s ,name=%s gpio=%d\n", __func__,name,gpio); ret = gpio_direction_output(gpio, 0); if (ret < 0) { pr_err(" %s: gpio_direction_output failed %d\n", __func__, ret); gpio_free(gpio); return ret; }
functions
void modem_on_for_uart_config(void) { pr_info(MODULE_NAME "%s ,first_time=%s uart_pin_pull_low=%d\n", __func__,first_time?"true":"false",uart_pin_pull_state); if(uart_pin_pull_state==0){ //if uart pin pull low, then we put back to normal pr_info(MODULE_NAME "%s tegra_gpio_disable for UART\n", __func__); tegra_gp...
functions
int modem_off_for_uart_config(void) { int err=0; pr_info(MODULE_NAME "%s uart_pin_pull_low=%d\n", __func__,uart_pin_pull_state); if(uart_pin_pull_state==1){ //if uart pin not pull low yet, then we pull them low+enable err=gpio_o_l_uart(TEGRA_GPIO_PJ7, "IMC_UART_TX"); err=gpio_o_l_uart(TEGRA_GPIO_PK7, "IMC_UART_R...
functions
int modem_off_for_usb_config(struct gpio *array, size_t num) { //pr_info(MODULE_NAME "%s 1219_01\n", __func__); int err=0; err = gpio_config_only_array(tegra_baseband_gpios_power_off_modem, ARRAY_SIZE(tegra_baseband_gpios_power_off_modem)); if (err < 0) { pr_err("%s - gpio_config_array gpio(s) for modem off fa...
functions
int modem_on_for_usb_config(struct gpio *array, size_t num) { pr_info(MODULE_NAME "%s \n", __func__); int err=0; err = gpio_config_only_array(tegra_baseband_gpios, ARRAY_SIZE(tegra_baseband_gpios)); if (err < 0) { pr_err("%s - gpio_config_array gpio(s) for modem off failed\n", __func__); return -ENODEV; }
functions
int config_gpio_for_power_off(void) { int err=0; pr_info(MODULE_NAME "%s for power consumation 4st \n", __func__); #if 1 /* config baseband gpio(s) for modem off */ err = modem_off_for_usb_config(tegra_baseband_gpios_power_off_modem, ARRAY_SIZE(tegra_baseband_gpios_power_off_modem)); if (err < 0) { pr_...
functions
int config_gpio_for_power_on() { int err=0; pr_info(MODULE_NAME "%s for power consumation 4st \n", __func__); #if 1 /* config baseband gpio(s) for modem off */ err = modem_on_for_usb_config(tegra_baseband_gpios, ARRAY_SIZE(tegra_baseband_gpios)); if (err < 0) { pr_err("%s - gpio_config_array gpio(s) fo...
functions
int baseband_modem_power_on(struct baseband_power_platform_data *data) { /* HTC: called in atomic context */ int ret=0, i=0; pr_info("%s VP: 07/05 22.52{\n", __func__); if (!data) { pr_err("%s: data is NULL\n", __func__); return -1; }
functions
int baseband_xmm_power_on(struct platform_device *device) { struct baseband_power_platform_data *data = (struct baseband_power_platform_data *) device->dev.platform_data; int ret; /* HTC: ENR#U wakeup src fix */ //int value; pr_info(MODULE_NAME "%s{\n", __func__); /* check for platform data */ if (!data) {...
functions
int baseband_xmm_power_off(struct platform_device *device) { struct baseband_power_platform_data *data; int ret; /* HTC: ENR#U wakeup src fix */ unsigned long flags; pr_info("%s {\n", __func__); if (baseband_xmm_powerstate == BBXMM_PS_UNINIT) { pr_err("%s: baseband_xmm_powerstate != BBXMM_PS_UNINIT\n", __fu...
functions
ssize_t baseband_xmm_onoff(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { //int size; struct platform_device *device = to_platform_device(dev); mutex_lock(&baseband_xmm_onoff_lock); /* check input */ if (buf == NULL) { pr_err("%s: buf NULL\n", __func__); mutex_unlock(&b...
functions
BB_XMM_OEM1 if (buf[0] == 0x01 || buf[0] == '1') { /* pr_info("%s: buf[0] = 0x%x\n", __func__, buf[0]); */ power_onoff = 1; }
functions
void baseband_xmm_set_power_status(unsigned int status) { struct baseband_power_platform_data *data = baseband_power_driver_data; //int value = 0; unsigned long flags; if (baseband_xmm_powerstate == status) return; pr_info(MODULE_NAME"%s{ status=%d\n", __func__,status); switch (status) { case BBXMM_PS_L0: ...
functions
0305 if (usbdev) { struct usb_interface *intf; intf = usb_ifnum_to_if(usbdev, 0); //pr_info("%s - autopm_get - usbdev = %d - %d {\n", __func__, usbdev, __LINE__); //pr_info("%s: cnt %d intf=%p &intf->dev=%p kobje=%s\n", //__func__, atomic_read(&intf->dev.power.usage_count),intf,&intf->dev,kobject...
functions
0 if (usbdev) { struct usb_interface *intf; intf = usb_ifnum_to_if(usbdev, 0); pr_info("%s: cnt %d intf=%p &intf->dev=%p kobje=%s\n", __func__, atomic_read(&intf->dev.power.usage_count),intf,&intf->dev,kobject_name(&intf->dev.kobj)); }
functions
irqreturn_t baseband_xmm_power_ipc_ap_wake_irq(int irq, void *dev_id) { int value; struct baseband_power_platform_data *data = baseband_power_driver_data; /* pr_info("%s\n", __func__); */ value = gpio_get_value(data->modem.xmm.ipc_ap_wake); if (ipc_ap_wake_state < IPC_AP_WAKE_IRQ_READY) { pr_err("%s - spuriou...
functions
else if (ipc_ap_wake_state == IPC_AP_WAKE_IRQ_READY) { if (!value) { pr_info("%s - IPC_AP_WAKE_INIT1" " - got falling edge\n", __func__); if (waiting_falling_flag == 0) { pr_info("%s return because irq must get the rising event at first\n", __func__); return IRQ_HANDLED; }
functions
else if (ipc_ap_wake_state == IPC_AP_WAKE_INIT1) { if (!value) { pr_info("%s - IPC_AP_WAKE_INIT2" " - wait for rising edge\n", __func__); }
functions
CONFIG_REMOVE_HSIC_L3_STATE if (baseband_xmm_powerstate == BBXMM_PS_L3) { spin_unlock(&xmm_lock); pr_info(" CP L3 -> L0\n"); pr_info("set wakeup_pending=true, wait for no-irq-resuem if you are not under LP0 yet !.\n"); pr_info("set wakeup_pending=true, wait for system resume if you alread...
functions
endif if (baseband_xmm_powerstate == BBXMM_PS_L2) { CP_initiated_L2toL0 = true; spin_unlock(&xmm_lock); baseband_xmm_set_power_status (BBXMM_PS_L2TOL0); }
functions
void baseband_xmm_power_reset_host_active_work(struct work_struct *work) { /* set host_active for interrupt modem */ int value = gpio_get_value(TEGRA_GPIO_PN1); pr_info("Oringial IPC_HSIC_ACTIVE =%d", value); gpio_set_value(TEGRA_GPIO_PN1,!value); msleep(100); gpio_set_value(TEGRA_GPIO_PN1,value); }