Referring to
The task control layer 3 comprises a plurality of control units including but not limited to an image compression task unit 30, a write file task unit 31, a sound read task unit 32 and an application program open unit 33 that access and operate with the data temporarily stored in the circular queue to execute the task for recording the audio/video frame data. The movie-format control layer 2 includes at least one movie-format control unit including but not limited to an AVI file format control unit 21 or a MOV file format control unit 20 for creating a file from the audio/video frame data.
The control programs of all units in the movie-format control layer 2 and the task control layer 3 are independent modules, and thus they can be added or maintained separately according to different special cases.
Referring to
Referring to
During the Step (S309), a write file task unit 31 in the task control layer 3 sets a buffer to a read status after a write file task detects a buffer which is set to a fill-up status (S311), and reads a plurality of compressed audio/video frame data temporarily stored in a buffer which has been set to a read status, and creates a movie-format file by the compressed audio/video frame data (S313), wherein the movie-format could be an AVI file format or a MOV file format.
Referring to
The buffer does not have any image frame data for the first time when the determined result is obtained in Step (S505), and thus if the determined result is no, the Step (S513) is used to directly set the size of the sound frame data, and the compressing image unit 11 in the general control layer 1 is used to compress an image frame data into the buffer (S515) to make it as the first record of image frame data, and update the recording information (S517). The application program open unit 33 in the task control layer 3 executes a task for opening an application program interface to provide related recording information (such as the remaining recording time, or a recording error) to a previous user interface (UI).
If an image change is detected again, the determined result of the existence of image frame data as described in Step (S505) will be yes, and a compressing sound unit 12 in the general control layer 1 will compress a sound frame data (S507) into the buffer based on the previously set size of the sound frame data, and determine whether or not the buffer is filled up (S509). If the determined result is yes, then the buffer will be set to a fill-up status, and another buffer which is set to a blank status will be obtained (S511) to continue a task for compressing audio/video frame data.
If the determined result of Step (S509) is no or after Step (S511), the size of the sound frame data will be set first (S513), and the image frame data will be compressed (S515), and finally the recording information will be updated (S517). By repeating the foregoing steps, the invention compresses the image frame data and the sound frame data into the buffer by an interlace compression method, so that an image compression task unit 30 in a task control layer 3 executes the task of compressing audio/video frame data.
In summation of the description above, the technical measures taken by the invention provides an improved software architecture, not only improving the extensibility, maintenance and readability of the software programs, but also enhancing the performance of executing the software program. The invention also has the following advantages:
1. The invention reduces unnecessary waste of memories. The circular queue is used as a buffer, so that it is not necessary to keep increasing the number of buffers for the queue architecture, and thus we no longer waste any unnecessary memory.
2. The products produced according to the method of the present invention allows manufactures to introduce their products time-to-market easily. With the improved software program, the software of the product can be developed, modified, and changed much faster, and thus manufacturers can be first to market.
Although the present invention has been described with reference to the preferred embodiments thereof, it will be understood that the invention is not limited to the details thereof. Various substitutions and modifications have been suggested in the foregoing description, and others will occur to those of ordinary skill in the art. Therefore, all such substitutions and modifications are intended to be embraced within the scope of the invention as defined in the appended claims.