3. The method of claim 1 , wherein registering a callback function for the video capture bottom layer library comprises: setting a first function by using a callback function interface of a header file defining external interfaces of a camera class in the video capture bottom layer library; and setting the first function as the callback function for the camera class in the video capture bottom layer library.
1. A method for capturing videos, comprising: setting a video capture class in a framework layer of a first programming language, the video capture class inheriting a class in a video capture bottom layer library and registering a callback function for the video capture bottom layer library; receiving, by the video capture class, a video capture command sent by an application in an application layer of a second programming language other than the first programming language; sending, by the video capture class, the video capture command to the video capture bottom layer library which starts to capture video data according to the video capture command; obtaining, by the video capture class, the video data from the video capture bottom layer library by using the callback function; sending, by the video capture class, the video data to an encoder which is pre-set in the framework layer of the first programming language and instructing the encoder to encode the video data; and providing, by video capture class, video data codes obtained by the encoder to the application in the application layer.