Permalink
Browse files

Added cpplint.py and a tools/ directory

Cleans up various parts of shotdetect:

1. File naming
2. Intentation and style
3. Added an "UI" directory
  • Loading branch information...
1 parent 53d58be commit 113ebf86637081969d63e6109e5cc25f9a892983 @johmathe committed Oct 6, 2012
View
@@ -146,15 +146,15 @@ ENDIF()
# shotdetect
SET(TARGET_NAME "shotdetect")
-INCLUDE_DIRECTORIES(. include)
+INCLUDE_DIRECTORIES(.)
# shotdetect library
-SET(${TARGET_NAME}_LIBRARY_SRCS src/film.cpp src/graph.cpp src/image.cpp src/shot.cpp src/xml.cpp)
-SET(${TARGET_NAME}_LIBRARY_HDRS include/film.h include/graph.h include/image.h include/shot.h include/xml.h)
+SET(${TARGET_NAME}_LIBRARY_SRCS src/film.cc src/graph.cc src/image.cc src/shot.cc src/xml.cc)
+SET(${TARGET_NAME}_LIBRARY_HDRS src/film.h src/graph.h src/image.h src/shot.h src/xml.h)
IF(USE_POSTGRESQL)
- SET(${TARGET_NAME}_LIBRARY_SRCS ${${TARGET_NAME}_LIBRARY_SRCS} src/bdd.cpp)
- SET(${TARGET_NAME}_LIBRARY_HDRS ${${TARGET_NAME}_LIBRARY_HDRS} include/bdd.h)
+ SET(${TARGET_NAME}_LIBRARY_SRCS ${${TARGET_NAME}_LIBRARY_SRCS} src/bdd.cc)
+ SET(${TARGET_NAME}_LIBRARY_HDRS ${${TARGET_NAME}_LIBRARY_HDRS} src/bdd.h)
ENDIF()
ADD_LIBRARY(${TARGET_NAME} ${${TARGET_NAME}_LIBRARY_SRCS} ${${TARGET_NAME}_LIBRARY_HDRS})
TARGET_LINK_LIBRARIES(${TARGET_NAME} ${FFMPEG_LIBRARIES} ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${GD_LIBRARIES})
@@ -174,12 +174,12 @@ ELSEIF(WIN32)
ENDIF()
IF(USE_WXWIDGETS AND wxWidgets_FOUND)
- SET(${TARGET_NAME}_GUI_SRCS src/main.cpp src/DialogHelp.cpp src/DialogShotDetect_c.cpp src/wxProcessVideoThread.cpp)
- SET(${TARGET_NAME}_GUI_HDRS include/DialogHelp.h include/DialogShotDetect_c.h include/wxProcessVideoThread.h)
+ SET(${TARGET_NAME}_GUI_SRCS src/main.cc src/ui/dialog_help.cc src/ui/dialog_shotdetect.cc src/ui/process_video_thread.cc)
+ SET(${TARGET_NAME}_GUI_HDRS src/ui/dialog_help.h src/ui/dialog_shotdetect.h src/ui/process_video_thread.h)
ADD_EXECUTABLE(${TARGET_NAME}-gui ${APP_TYPE} ${${TARGET_NAME}_GUI_SRCS} ${${TARGET_NAME}_GUI_HDRS})
TARGET_LINK_LIBRARIES(${TARGET_NAME}-gui ${TARGET_NAME})
ELSE()
- SET(${TARGET_NAME}_COMMANDLINE_SRCS src/commandline.cpp)
+ SET(${TARGET_NAME}_COMMANDLINE_SRCS src/commandline.cc)
ADD_EXECUTABLE(${TARGET_NAME}-cmd ${${TARGET_NAME}_COMMANDLINE_SRCS})
TARGET_LINK_LIBRARIES(${TARGET_NAME}-cmd ${TARGET_NAME})
-ENDIF()
+ENDIF()
View
@@ -1,23 +0,0 @@
-/* config.h. Generated from config.h.in by configure. */
-/* config.h.in. Generated from configure.in by autoheader. */
-/* $Id */
-/* Name of package */
-#define PACKAGE "shotdetect"
-
-/* Define to the address where bug reports for this package should be sent. */
-#define PACKAGE_BUGREPORT "johan.mathe@tremplin-utc.fr"
-
-/* Define to the full name of this package. */
-#define PACKAGE_NAME "film.cpp"
-
-/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "film.cpp 1.0"
-
-/* Define to the one symbol short name of this package. */
-#define PACKAGE_TARNAME "film-cpp"
-
-/* Define to the version of this package. */
-#define PACKAGE_VERSION "1.0"
-
-/* Version number of package */
-#define VERSION "1.0.1"
View
@@ -1,235 +0,0 @@
-/*
- * $Id: film.h 193 2010-09-30 23:02:58Z peterb $
- * $Date: 2010-10-01 01:02:58 +0200 (Fri, 01 Oct 2010) $
- */
-#ifndef __FILM_H__
-#define __FILM_H__
-
-#ifndef INT64_C
-#define INT64_C(c) (c ## LL)
-#define UINT64_C(c) (c ## ULL)
-#endif
-
-#define THUMB_HEIGHT 84
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <list>
-
-extern "C" {
-
-#include <libavcodec/avcodec.h>
-#include <libavformat/avformat.h>
-
-}
-
-#ifdef BDD
-#include <postgresql/libpq-fe.h>
-#endif
-#ifdef WXWIDGETS
-#include <wx/wx.h>
-#endif
-
-#include "image.h"
-#include "shot.h"
-#include "xml.h"
-#include "graph.h"
-
-#include <string>
-#include <iostream>
-
-#define MAX_STR 254
-#define MAX_CUTS 200
-#define abs(x) ((x) < 0 ? - (x) : (x))
-#define HAVE_THREADS
-#define MAX_QUERY 400
-
-#define DEFAULT_BDD_PORT 5432
-#define DEFAULT_THUMB_HEIGHT 85
-#define DEFAULT_THRESHOLD 60
-
-#define RATIO 327
-#define MIN_INT -32768
-#define MAX_INT 32767
-
-
-
-using namespace std;
-
-class image;
-class conf;
-class shot;
-class xml;
-class DialogShotDetect_c;
-class graph;
-class film
-{
-
- private:
- /* Variables d'état */
- bool first_img_set;
- bool last_img_set;
- bool audio_set;
- bool video_set;
-
-
- unsigned int ech;
- signed short int minright;
- signed short int maxright;
- signed short int minleft;
- signed short int maxleft;
-
-
- /* Various data for ffmpeg */
- AVFormatContext *pFormatCtx;
- AVCodecContext *pCodecCtx;
- AVCodecContext *pCodecCtxAudio;
- AVCodec *pCodec;
- AVCodec *pCodecAudio;
- AVFrame *pFrame;
- AVFrame *pFrameRGB;
- AVFrame *pFrameRGBprev;
- AVPacket packet;
-
- FILE *fd_xml_audio;
-
- int samples;
- int data_size;
- uint8_t *ptr;
-
- int len1;
- int len;
- int samplerate;
- int checknumber;
-
- /* Mem allocation */
- short *audio_buf;
- signed short int sample_right;
- signed short int sample_left;
- int ret;
- int audioStream;
- int videoStream;
-
- int samplearg;
-
- void do_stats (int frame);
- void CompareFrame (AVFrame * pFrame, AVFrame * pFramePrev);
- graph *g;
-
- void update_metadata();
- void init_xml (string filename);
- int close_xml ();
-
- public:
- bool thumb_set ;
- bool shot_set ;
-
-
- DialogShotDetect_c * dialogParent;
- struct
- {
- int id;
- string name;
- string surname;
- } author;
-
- struct
- {
- string video;
- string audio;
- } codec;
-
- struct
- {
- int hours;
- int mins;
- int secs;
- int us;
- double mstotal;
- } duration;
-
- int myid;
- static int idfilm;
-
- int progress_state_prev;
- /* Name of the movie */
- string film_name;
- /* Title of the movie */
- string title;
- /* Abstract of the movie */
- string abstract;
- /* Path to the film */
- string input_path;
- /* Film height */
- int height;
- /* Film width */
- int width;
- /* Film fps */
- double fps;
- /* Number of audio chanels */
- int nchannel;
- /* Year of the movie */
- int year;
- /* Shots */
- list < shot > shots;
- /* Prev Score in compare_frame */
- int prev_score;
- /* ID BDD Film */
- int id;
- /* id du plan en cours de traitement */
- int id_plan;
- /* Language code */
- string code_lang;
- /* Processing threshold */
- int threshold;
- /* Alphanumeric ID */
- string alphaid;
- /* Absolute path */
- string global_path;
- /* Percent accomplished */
- double percent;
- /* Showing state started */
- bool show_started;
- xml *x;
- bool display;
-
- int process ();
- void process_audio ();
- void shotlog(string message);
- void create_main_dir(void);
-
- /* Constructor */
- film ();
- #ifdef WXWIDGETS
- film (DialogShotDetect_c *);
- #endif
-
- /* Accessors */
- inline void set_first_img(bool val) {this->first_img_set = val; };
- inline void set_last_img(bool val) {this->last_img_set = val; };
- inline void set_audio(bool val) {this->audio_set = val; };
- inline void set_video(bool val) {this->video_set = val; };
- inline void set_thumb(bool val) {this->thumb_set = val; };
- inline void set_shot(bool val) {this->shot_set = val; };
- inline void set_input_file(string input_file) { this->input_path = input_file; };
- inline void set_threshold(int threshold) { this->threshold=threshold; };
- inline void set_ipath(string path) { this->input_path = path; };
- inline void set_opath(string path) { this->global_path = path; };
- inline void set_year(int year) { this->year=year; };
- inline void set_alphaid(string alphaid) { this->alphaid = alphaid; };
- inline void set_title(string title) { this->title = title; };
-
- inline bool get_first_img(void) { return this->first_img_set ; };
- inline bool get_last_img(void) { return this->last_img_set ; };
- inline bool get_audio(void) { return this->audio_set ; };
- inline bool get_video(void) { return this->video_set ; };
- inline bool get_thumb(void) { return this->thumb_set ; };
- inline bool get_shot(void) { return this->shot_set ; };
- inline string get_ipath(void) { return this->input_path ; };
- inline string get_opath(void) { return this->global_path ; };
- inline double get_fps(void) { return this->fps ; };
-
-};
-
-
-#endif /* !__FILM_H__ */
View
@@ -1 +0,0 @@
-timestamp
View
@@ -1,15 +0,0 @@
-# Fichier pour automake
-INCLUDES= -I../include -I../resources/ `wx-config --cflags` `xslt-config --cflags`
-bin_PROGRAMS = shotdetect
-shotdetect_LDADD = -lgd -lz -lavformat -lavcodec -lavutil
-shotdetect_LDFLAGS = `wx-config --libs` `xslt-config --libs`
-shotdetect_SOURCES = \
-graph.cpp \
-film.cpp \
-image.cpp \
-shot.cpp \
-xml.cpp \
-wxProcessVideoThread.cpp \
-DialogShotDetect_c.cpp \
-DialogHelp.cpp \
-main.cpp
Oops, something went wrong.

0 comments on commit 113ebf8

Please sign in to comment.