# samples/backend/v4l2_backend_main.cpp File Reference

`#include "NvUtils.h"`
`#include <errno.h>`
`#include <fstream>`
`#include <iostream>`
`#include <cstdlib>`
`#include <cstring>`
`#include <linux/videodev2.h>`
`#include <pthread.h>`
`#include <string.h>`
`#include <unistd.h>`
`#include "NvCudaProc.h"`
`#include "nvbuf_utils.h"`
`#include "v4l2_nv_extensions.h"`
`#include "v4l2_backend_test.h"`
`#include <sys/time.h>`

Go to the source code of this file.

## Defines

#define | TEST_ERROR(cond, str, label)
#define | CHUNK_SIZE 4000000
#define | MIN(a, b) (((a) < (b)) ? (a) : (b))
#define | NAL_UNIT_START_CODE 0x00000001
#define | MIN_CHUNK_SIZE 50
#define | USE_CPU_FOR_INTFLOAT_CONVERSION 0
#define | IS_NAL_UNIT_START(buffer_ptr)
#define | IS_NAL_UNIT_START1(buffer_ptr)

## Functions

int | main (int argc, char *argv[])

## Variables

const char * | GOOGLE_NET_DEPLOY_NAME
const char * | GOOGLE_NET_MODEL_NAME
EGLDisplay | egl_display
jpeg_enc_context_t | g_jpeg_enc_context

## Define Documentation

#define CHUNK_SIZE 4000000

Definition at line 54 of file v4l2_backend_main.cpp.

#define IS_NAL_UNIT_START | ( | buffer_ptr |  | ) |

Value:

    (!buffer_ptr[0] && !buffer_ptr[1] && \
            !buffer_ptr[2] && (buffer_ptr[3] == 1))

Definition at line 70 of file v4l2_backend_main.cpp.

#define IS_NAL_UNIT_START1 | ( | buffer_ptr |  | ) |

Value:

    (!buffer_ptr[0] && !buffer_ptr[1] && \
            (buffer_ptr[2] == 1))

Definition at line 73 of file v4l2_backend_main.cpp.

#define MIN | ( | a,
|  | b |  | ) | (((a) < (b)) ? (a) : (b))

Definition at line 56 of file v4l2_backend_main.cpp.

#define MIN_CHUNK_SIZE 50

Definition at line 60 of file v4l2_backend_main.cpp.

#define NAL_UNIT_START_CODE 0x00000001

Definition at line 59 of file v4l2_backend_main.cpp.

#define TEST_ERROR | ( | cond,
|  | str,
|  | label |  | ) |

Value:

    if(cond) { \
                                            cerr << str << endl; \
                                            error = 1; \
                                            goto label; }

Definition at line 49 of file v4l2_backend_main.cpp.

#define USE_CPU_FOR_INTFLOAT_CONVERSION 0

Definition at line 61 of file v4l2_backend_main.cpp.

## Function Documentation

int main | ( | int | argc,
|  | char * | argv[] |
| ) |  |  |

Definition at line 1455 of file v4l2_backend_main.cpp.

## Variable Documentation

EGLDisplay egl_display

Definition at line 98 of file v4l2_backend_main.cpp.

jpeg_enc_context_t g_jpeg_enc_context

Definition at line 99 of file v4l2_backend_main.cpp.

const char* GOOGLE_NET_DEPLOY_NAME

Initial value:

            "../../data/model/GoogleNet-modified.prototxt"

Definition at line 65 of file v4l2_backend_main.cpp.

const char* GOOGLE_NET_MODEL_NAME

Initial value:

            "../../data/model/GoogleNet-modified-online_iter_30000.caffemodel"

Definition at line 67 of file v4l2_backend_main.cpp.